location ^~ /constructor {
if (...) {
}
try_files ...;
}
map $platform $front_path {
default /home/www/redesigned_spa_desktop/dist;
mobile /home/www/redesigned_spa/dist;
}
server {
location ^~ /constructor {
alias $front_path;
try_files $uri /constructor/index.html;
}
map $args $_args {
~^redirect=[^&]*&?(.*) $1;
~^(.*?)&redirect=[^&]*(&?.*) $1$2;
}
server {
location = / {
error_page 418 = @rewrite;
if ($arg_redirect ~ '^(?<_url>https?://[\w.-]+)') {
return 418;
}
}
location @rewrite {
rewrite ^ /?$_args? break;
proxy_pass $_url;
proxy_http_version 1.1;
proxy_ssl_server_name on;
resolver 8.8.8.8;
}
try_files $imgdir/$imgfile /../static$uri /../static1$uri /../static2$uri /../static3$uri @image;
proxy_set_header Host $host;
.api.vk.com
на site.ru
и сервер вк честно отвечает что нет у него такого site.ru
.proxy_set_header Host $host;
http {
proxy_cache_path /tmp/nginx_cache keys_zone=one:10m;
server {
listen 80;
server_name sandbox6.dev.ru;
location / {
return 403 ;
}
location ~ ^/api/v2/qa/diff/(?<cache_key>[0-9]+) {
proxy_pass http://test.qa.ru;
proxy_http_version 1.1;
rewrite "^/api/v2/qa/diff/(.*)" /api/push/diff/$1 break;
add_header X-Proxy-Cache $upstream_cache_status;
proxy_cache one;
proxy_cache_valid 200 2h;
proxy_cache_key $scheme$proxy_host$cache_key$is_args$args;
}
}
rewrite ^/url1/(url2/url3/) https://domain2.ru/$1 permanent;
if ($request_uri ~ '^/url1/(url2/url3/.*)') {
return 301 https://domain2.ru/$1;
}
root /root/pages;
location = / {
alias /root/index.html;
}
location / {
}
proxy_hide_header X-Frame-Options;
add_header
. set $root_path /var/www/mysite_domain_ru_usr/data/www/mydomain.ru;
root $root_path;
disable_symlinks if_not_owner from=$root_path;
location / {
index index.php index.html;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
# не работает вариант
if ($arg_tag) {
rewrite ^/(.*)$ /$arg_tag/? permanent;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/mydomain.ru.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
set $root_path /var/www/mysite_domain_ru_usr/data/www/mydomain.ru;
root $root_path;
disable_symlinks if_not_owner from=$root_path;
location / {
index index.php index.html;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
location /category/ {
if ($arg_tag) {
rewrite ^ /category/$arg_tag/? permanent;
}
rewrite ^/([^/]+/)([^/]+)/$ /index.php?q=$1&tag=$2 last;
rewrite ^/(.+)$ /index.php?q=$1 last;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/mydomain.ru.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
location ^~ /uploads/thumbs/ {
root /home/admin/web/site-b.com/public_html;
try_files $uri @proxy;
}
location @proxy {
proxy_pass http://11.22.33.44:80$uri;
proxy_set_header Host site-a.com;
}
location /_next/static/ {
alias /var/www/promo/nextjs-coupon/.next/static;
^~
и в alias добавить /
location ^~ /_next/static/ {
alias /var/www/promo/nextjs-coupon/.next/static/;