proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:1337;
server {
listen 80;
location / {
include node-proxy.inc;
}
location /test/ {
add_header Tester '1';
include node-proxy.inc;
}
}
server {
listen 80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
proxy_pass http://127.0.0.1:1337;
}
location /test/ {
add_header Tester '1';
proxy_pass http://127.0.0.1:1337;
}
}
ssl_protocols ...
...
ssl_session...
server {
listen 80;
server_name example.ru;
return 301 https://example.ru$request_uri;
}
server {
listen 80;
listen 443 ssl spdy;
server_name www.example.ru;
return 301 https://example.ru$request_uri;
}
server {
listen 443 ssl spdy;
server_name example.ru;
root ...
add_header ...
location ...
}
location /yii2-test-job
./index.php
(ктати, никогда не понимал нафига там дописывать ?$args
), вы попадаете в location ~ \.php$
и там действует root сервера.server {
root /var/www/default;
index index.php index.html;
location /yii2-test-job {
alias /var/www/default/yii2-test-job/web;
try_files $uri $uri/ /yii2-test-job/index.php;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
}
server {
listen 80 default_server;
return 404;
}
server {
listen 80;
server_name example.com www.example.com;
...
}