proxy_cache_path /var/cache/nginx levels=2 keys_zone=pagecache:5m inactive=10m max_size=50m;
server {
listen 80;
server_name domain.ru;
root /var/www/html;
rewrite ^/(pricing|contacts)/?(.*) /$2;
location ~ \.(js|css)$ {
try_files $uri @custom_cache;
}
location / {
try_files $uri/index.html $uri @custom;
}
location @custom {
proxy_pass http://ru_backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location @custom_cache {
proxy_cache pagecache;
proxy_cache_valid 10m;
proxy_pass http://ru_backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
rewrite ^/(.*(?:pdf|epub))$ /wp-content/themes/divi-child/download.php?file=$1;
RewriteEngine On
RewriteCond %{THE_REQUEST} " /sites/index\.php\?action=site&cid=([^ &]+)"
RewriteRule ^ /game/%1? [R=301,L,NE]
RewriteCond %{QUERY_STRING} ^art_(id=.*)
RewriteRule ^(article)$ /$1?%1 [R=301,L]
httpd configuration files contain one directive per line. The backslash "\" may be used as the last character on a line to indicate that the directive continues onto the next line. There must be no other characters or white space between the backslash and the end of the line.
php_admin_value open_basedir = "\
E:\Websites;\
C:\PHP\includes\
"
server {
listen 80;
server_name www.site.ru;
return 301 http://site.ru$request_uri;
}
server {
listen 80;
server_name site.ru;
root /var/www/html;
rewrite ^/rss\.xml$ /data/rss.php;
rewrite ^/sitemap\.xml$ /data/sitemap.php;
location @handler {
rewrite ^/(.*)$ /data/engine.php?a=$1;
}
location / {
try_files $uri $uri/ @handler;
}
location ~ \.php$ {
try_files $uri =404;
# Тут нужно добавить свои параметры fastcgi
}
}
$re = <<<'END'
@
\G(?!\A)
(?: [^\[]+ | (?! \[/?quote). )*+ \K
(
\[quote[^\]]*\]
(?: [^\[]+ | (?!\[/?quote). | (?1) )*+
\[/quote\]
)
| \[quote[^\]]*\] \K
@xi
END;
$str = preg_replace($re, '', $str);
RedirectMatch 301 ^((?:[^/]*/)++(?<!/order/).*)\.html$ $1/
RewriteEngine On
RewriteCond %{REQUEST_URI} !/order/[^/]+$
RewriteRule ^(.*)\.html$ /$1/ [R=301,L]
(?xs)
sprintf_w\(
(
(?: " (?: [^"\\] | \\. )*+ "
| ' (?: [^'\\] | \\. )*+ '
| [^"',()]+
| \( (?1) \)
)*+
)
location
nginx.org/ru/docs/http/ngx_http_core_module.html#l...Чтобы найти location, соответствующий запросу, вначале проверяются location’ы, заданные префиксными строками (префиксные location’ы). Среди них ищется location с совпадающим префиксом максимальной длины и запоминается. Затем проверяются регулярные выражения, в порядке их следования в конфигурационном файле. Проверка регулярных выражений прекращается после первого же совпадения, и используется соответствующая конфигурация. Если совпадение с регулярным выражением не найдено, то используется конфигурация запомненного ранее префиксного location’а.
Если у совпавшего префиксного location’а максимальной длины указан модификатор “^~”, то регулярные выражения не проверяются.
Кроме того, с помощью модификатора “=” можно задать точное совпадение URI и location. При точном совпадении поиск сразу же прекращается.
location ~ [^/]\.php(/|$)
=
или ^~
, чтобы поиск сразу же прекратился и регулярные выражения не проверялись.location = /etrade_http_tunnel/etrade_http_tunnel.php {
fastcgi_read_timeout 1000;