return 301 https://$host$request_uri;
proxy_pass
.server {
listen 443 ssl;
server_name ваш-домен.ру;
proxy_pass https://берём-содержимое.ру;
proxy_cookie_domain берём-содержимое.ру ваш-домен.ру;
location = /bitrix/admin/1c_exchange.php {
auth_basic off;
fastcgi_pass php-fpm:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# первая страничка
location = /info/site1-page/page {
alias /home/sites/site_1/index.html;
}
# вторая страничка
location = /info/site2-page/page {
alias /home/sites/site_2/index.html;
}
^(?<name>\w\d+)
никогда не совпадёт с строкой shop1
https://regex101.com/r/4rLjsI/1\w
нужно добавить +
^(?<name>\w+\d+)
location / {
root /home/apps/project1/public;
}
location /project2 {
alias /home/apps/project2/public;
try_files $uri /index.html =404;
}
location /project3 {
alias /home/apps/project3/public;
try_files $uri /index.html =404;
}
map $args $replace {
volatile;
default $args;
~^(.*)HELLO(.*) "$1NO$2";
}
server {
location /server/load.php {
rewrite ^ $uri?$replace?;
rewrite ^ $uri?$replace? break;
proxy_pass localhost:88;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
}
Запросы с пустым значением ключа не учитываются.
map $arg_method $var {
default "";
"phone" $binary_remote_addr;
}
limit_req_zone $var zone=perip:10m rate=5r/s;
server {
rewrite ^/([^/]+)/([^/]+)/([^/.]+)$ /index.php?get1=$1&get2=$2&get3=$3;
rewrite ^/([^/]+)/([^/.]+)$ /index.php?get1=$1&get2=$2;
rewrite ^/([^/.]+)$ /index.php?get1=$1;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~ /\. {
deny all;
}
/\.
ловит любые адреса где после слэша идёт точка.location ~ \.php$ {
include fastcgi_params;
fastcgi_param REQUEST_URI $request_uri;
map $request_uri $_fix_request_uri {
default $request_uri;
~^/mcs/users(/graphql/.*)$ $1;
}
server {
location ~ \.php$ {
include fastcgi_params;
fastcgi_param REQUEST_URI $_fix_request_uri;
server {
listen 80;
server_name example.com www.example.com;
root /var/www/example.com;
}
server {
listen 80;
server_name *.example.com;
root /var/www/$host;
}
server {
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.*) /index.php?altum=$1;
}
location ~ \.php$ {
...
}
server {
location ~ \.php$ {
...
}
location ~ ^/(.*) {
try_files $uri $uri/ /index.php?altum=$1&$args;
}
map $uri $_uri {
~^/(.*) $1;
}
server {
location / {
try_files $uri $uri/ /index.php?altum=$_uri&$args;
}
location ~ \.php$ {
...
}
map "$remote_addr;$args" $var {
default 0;
"~^94\.143\.197\.26;full_slug=[^&]*&cat=-1&page=\d*$" 1;
}
server {
location = /seek {
if ($var) {
return 403;
}
rewrite ^ /index.php;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location /client/dev {
alias /var/www/site.ru/build;
try_files $uri /index.html =404;
}
location /client/dev {
alias /var/www/site.ru/build;
try_files $uri /client/dev/index.html;
}