server {
listen 443 ssl;
server_name site.io;
access_log off;
ssl_certificate "/var/node/********.crt";
ssl_certificate_key "/var/node/********.key";
root /var/www/service/public_html;
location / {
index index.php index.html index.htm;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/api/v2/(.+) {
try_files $uri /api/v2/index.php?q=$1&$args;
}
}
$uri/
location / {
try_files $uri /index.php?$query_string;
}
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
rewrite ^/x/d/f\.png$ /styles/x/d/f.png;
rewrite ^/(\d+/\d+/\d+\.png)$ /styles/$1;
RewriteRule ^([^/]+\.(jpe?g|png|gif))$ /wp-content/uploads/2020/01/$1 [R=301,L]
Rewrite ^/([^/]+\.(jpe?g|png|gif))$ /wp-content/uploads/2020/01/$1 permanent;
server {
server_name my.domain.com;
location / {
proxy_pass http://domain.com/my/;
}
}
location ^~ /upload {
location ~ \.(png|jpe?g|gif)$ {
}
return 403;
}
location ^~ /source {
location ~ \.(js|css)$ {
}
return 403;
}
location ~* \.(jpe?g|gif|png|svg)$ {
if ($arg_moderation = "on") {
rewrite ^ /upload/system/no-avatar.jpg break;
}
}
location /comment-subscriptions/ {
add_header X-Robots-Tag "noindex, nofollow" always;
}
location ~ \.php$ {
if ($arg_srsrc = "f") {
add_header X-Robots-Tag "noindex, nofollow" always;
}
location = / {
root /usr/share/nginx/html;
rewrite ^ /index.html break;
}
location = /api/servertime {
access_log off;
rewrite ^ /index.php break;
include fastcgi.conf;
fastcgi_pass php;
}
location ~ \.php$
location ~ \.php$ {
if ($request_uri ~ "^/api/servertime") {
access_log off;
}
include fastcgi.conf;
fastcgi_pass php;
}
access_log путь [формат [if=условие]];
map $request_uri $loggable {
default 1;
~^/api/servertime 0;
}
server {
# ...
root /var/www/lumen/public;
try_files $uri $uri/ /index.php$is_args$args;
# ...
location ~ \.php$ {
access_log /var/log/nginx/access.log combined if=$loggable;
include fastcgi.conf;
fastcgi_pass php;
}
}
location ~ ^/c/(?!index\.php|d\.php|t\.js|app/project/_resource/s/|app/project/[^/]+/js/c\.min\.js) {
return 403;
}
location ^~ /c/ {
return 403;
location ~ ^/c/(index|d)\.php {
fastcgi_pass ...;
include fastcgi_params;
}
location = /c/t.js { }
location /c/app/project/_resource/s/ { }
location ~ ^/c/app/project/[^/]+/js/c\.min\.js { }
}
server {
...
root /home/site/public_html;
rewrite ^/(ru|en)?/?(faq|news|page|catalogue|basket|photos|search|users)(.*)$ /index.php?lang=$1&module=$2&mod_rewrite=$3;
rewrite ^/$ /index.php;
location / { }
location ~ \.php$ {
fastcgi_pass unix:/tmp/php-fpm7.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|woff|ogg|mpe?g|avi|zip|gz|rar)$ {
add_header Pragma public;
add_header Cache-Control "public";
access_log /home/site/cache.log;
expires 1d;
}
}
location ^~ /files/ {
if (!-e $request_filename){
return 301 http://images.site.ru$uri;
}
}
location ^~ /files/ {
try_files $uri =404;
error_page 404 =301 http://images.site.ru$uri;
}
location ~ /(wp-login|admin)\.php {
set $humantest 0;
if ($http_cookie !~* "humans=checktest") {
set $humantest 1;
}
if ($args ~* (callback|logout|lostpassword)) {
set $humantest 0;
}
if ($humantest = 1) {
add_header Content-Type text/html;
return 200 "<html><body><script>document.cookie='humans=checktest;path=/';location.reload();</script></body></html>";
}
error_page 404 = @fallback;
include fastcgi_params;
fastcgi_pass ...
}
location ~ \.php
server {
listen 80;
server_name xxx.ru;
root /var/www/html/vfm;
index index.php;
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_pass fastcgi_backend_71;
}
location ^~ /hite {
root /var/www/html;
location ~ \.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_pass fastcgi_backend_71;
}
}
}