RewriteEngine On
RewriteCond %{THE_REQUEST} " /start\.php\?id=(\d+) "
RewriteRule ^ https://my-bot.ru/start/id/%1? [R=301,L]
RewriteRule ^start/id/(\d+)$ /start.php?id=$1 [L]
location / {
try_files $uri $uri/ /index.php;
}
location ~ [^/]\.php(/|$) {
try_files $uri =404;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
location / {
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
RewriteRule .* index.php [L]
а внизу RewriteRule ^admin/api/(.*) /adminko/?act=api&api=$1 [NS,L]
.%
на \x
RewriteRule ^\xD0\xBD\xD0\xB0\xD1\x88\xD0\xB8-\xD1\x83\xD1\x81\xD0\xBB\xD1\x83\xD0\xB3\xD0\xB8/\xD0\xBE\xD1\x86\xD0\xB5\xD0\xBD\xD0\xBA\xD0\xB0-\xD0\xB6\xD0\xB8\xD0\xBB\xD0\xBE\xD0\xB9-\xD0\xBD\xD0\xB5\xD0\xB4\xD0\xB2\xD0\xB8\xD0\xB6\xD0\xB8\xD0\xBC\xD0\xBE\xD1\x81\xD1\x82\xD0\xB8/\xD0\xBE\xD1\x86\xD0\xB5\xD0\xBD\xD0\xBA\xD0\xB0-\xD0\xB4\xD0\xBE\xD0\xBB\xD0\xB8-\xD0\xB2-\xD0\xBA\xD0\xB2\xD0\xB0\xD1\x80\xD1\x82\xD0\xB8\xD1\x80\xD0\xB5/$ https://psocenka.ru/ocenka-doli-v-kvartire [R=301,L]
location = / {
rewrite ^$ router/;
}
/
не совпадает с шаблоном ^$
.location / {
rewrite ^(.*)$ router/$1 break;
}
location /router {
try_files $uri $uri/ /router/index.php;
}
location /router
location / {
try_files /router$uri /router$uri/ /router/index.php;
}
root /home/vadosiq/server/public_html/router;
location / {
try_files $uri $uri/ /index.php;
}
*.lulzslab.ru
.Name-based virtual hosts for the best-matching set of <virtualhost>s
are processed in the order they appear in the configuration. The first matching ServerName or ServerAlias is used, with no different precedence for wildcards (nor for ServerName vs. ServerAlias).
ServerAlias: *.lulzslab.ru
если он окажется подлючён раньше файла dream.lulzslab.ru.conf.Include sites-enabled/*conf
httpd.apache.org/docs/2.4/mod/core.html#includeShell-style (fnmatch()) wildcard characters can be used in the filename or directory parts of the path to include several files at once, in alphabetical order.
*.lulzslab.ru
в настройках основного домена. RewriteRule ^(pages|confirm|captcha|listing|api|search|account|banlist|cabinet|servers|payment_gateway|admin_[^/]+)(/.*)?$ /monitoring/$0 [L]
RewriteRule ^api/?$ /?module=api [L]
/?module=api
так запрос будет отправлен в корень сайта.?module=api
так запрос останется в /monitoring/.RewriteEngine On
#Вызов страницы 404
ErrorDocument 404 /monitoring/?404
#Динамические страницы
RewriteRule ^pages/([^/]+).htm$ ?module=pages&url=$1 [L]
#Сброс пароля
RewriteRule ^confirm/([^/]+)/$ ?module=password_reset&confirm=$1 [L]
#Каптча
RewriteRule ^captcha/?$ ?module=captcha [L]
#Листинг
RewriteRule ^listing/?$ ?module=listing [L]
#API
RewriteRule ^api/?$ ?module=api [L]
#Поиск
RewriteRule ^search/?$ ?module=search [L]
#Авторизация, регистрация и тд.
RewriteRule ^account/([a-z]+)/?$ ?module=account&action=$1 [L]
#Банлист
RewriteRule ^banlist/?$ ?module=banlist [L]
#Кабинет
RewriteRule ^cabinet/?$ ?module=cabinet [L]
RewriteRule ^cabinet/([a-z]+)/?$ ?module=cabinet&action=$1 [L]
#Страница сервера
RewriteRule ^servers/([0-9.:]*)/([a-z]+)/?$ ?module=servers&ip=$1&action=$2 [L]
#Модуль принятия оплаты
RewriteRule ^payment_gateway/([a-z]*)/([a-z]*)?/$ ?module=payment_gateway&gateway=$1&action=$2 [L]
#Админка
RewriteRule ^admin_([^/]+)/$ ?module=admin_$1 [L]
RewriteRule ^admin_([^/]+)/([a-z]+)/?$ ?module=admin_$1§ion=$2 [L]
RewriteRule ^admin_([^/]+)/([a-z]+)/([0-9]+)/?$ ?module=admin_$1§ion=$2&id=$3 [L]
RewriteRule ^admin_([^/]+)/([a-z]+)/([0-9a-z_]+)/?$ ?module=admin_$1§ion=$2&subsection=$3 [L]
/
в конце./.well-known/acme-challenge/
, то довольно странно ожидать что он сработает для /.well-known/acme-challenge
./
в конце.location ^~ /.well-known/acme-challenge {
perl_set $var '
sub {
open(my $fh, "<", "/path/to/my.conf") || return "default value";
my $data = <$fh>;
close($fh);
return $data;
}
';
server {
...
proxy_set_header whatever $var;
...
}
А чуть ниже почему-то не https, а уже просто http.
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]