map $http_referer $index {
default $uri;
'~http://google.ru/apps/' '/apps/index.html';
}
try_files $index $uri $uri/ /index.html;
server {
listen 80;
listen 443 ssl http2;
ssl_certificate /cert.crt;
ssl_certificate_key /key.key;
server_name www.example.com;
return 301 https://example.com$request_uri;
}
server {
listen 80;
listen 443 ssl http2;
ssl_certificate /cert.crt;
ssl_certificate_key /key.key;
server_name example.com;
index index.html index.htm index.php index.cgi index.pl index.xhtml;
location ~ /\. { internal; }
location / { rewrite ^([^.\?]*[^/])$ $1/ permanent; }
location /odminka/ { }
location /guide { }
try_files $uri $uri/ /index.php/$uri;
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
}
server {
listen 127.0.0.1:80;
...
}
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
...
}
server {
listen 80;
listen 443 ssl;
set $https "0";
if ($scheme != "https") { set $https "A"; }
if ($remote_addr != "127.0.0.1") { set $https "${https}B"; }
if ($https = "AB") { rewrite ^ https://$http_host$request_uri? permanent; }
...
}
map "$scheme:$remote_addr" $https {
"https:*" 0;
"http:127.0.0.1" 0;
default 1;
}
server {
listen 80;
listen 443 ssl;
if ($https) { rewrite ^ https://$http_host$request_uri? permanent; }
...
}
server {
listen 127.0.0.1:80;
include vhost.conf;
}
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
include vhost.conf;
}
location ~ \.xml$ {
sub_filter_once off;
sub_filter_types *;
sub_filter_last_modified on;
sub_filter 'site.ru' $host;
}
location = /sitemap.xml {
alias /var/www/site.ru/sitemap-$host.xml;
}
location = /sitemap.xml {
rewrite ^.*$ /sitemap-$host.xml break;
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|pdf|txt|webp)$ {
access_log off;
expires 8d;
}
if (!-e $request_filename) { rewrite ^.*$ /index.php; }
Необходимо чтобы при обращении пользователя у которого установлена кука скажем DOMEN == r все агенты на хостинге считали что идет обращение к домену r.site.my