Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
Syntax: error_page code ... [=[response]] uri; Context: http, server, location, if in location
include /etc/nginx/sites-enabled/*;
cd /etc/nginx/sites-enabled/
geo $client { default third; 10.50.0.0/16 second; 178.50.0.0/16 first; } server{ location / { try_files $uri.$client $uri = 404; } }
proxy_set_header Host $host
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
sudo cat /etc/php/8.1/fpm/pool.d/*.conf | grep sock
listen = /var/run/php/php8.1-fpm.sock
location /marketplace/api/stocks{ } location / { if (!-f $request_filename) { rewrite ^([^.]*[^/])$ $1/ permanent; } if (!-f $request_filename) { rewrite ^(.*)/index.php$ $1/ redirect; } }
geo $upstream { default default_upstream; 10.50.0.0/16 ticket_upstream; } upstream default_upstream { server 10.10.10.25:80; } upstream ticket_upstream { server 10.10.10.25:80; } server { location / { ... proxy_pass http://$upstream; } }
proxy_intercept_errors on; error_page 301 302 307 = @handle; location @handle { set $redirect_location '$upstream_http_location'; }
sudo nano /etc/hosts
127.0.0.1 dk2022.loc
server_name ~^(www\.)?(?<domain>.+)$; root /var/www/$domain/public_html/;
location /one { add_header Content-Type text/plain always; location /one/two { return 200 'two'; } location /one/three { return 200 'three'; } return 200 'one'; }
location /man-main { try_files $uri $uri/ /index.php?route=common/home&gender=m; } location /woman-main { try_files $uri $uri/ /index.php?route=common/home&gender=w; }
location / { if ($server_protocol ~* "HTTP/1*") { proxy_pass url; } }