server listen 80 server_name test com set root_path var www test root

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
server{
listen 80;
server_name test.com;
set $root_path '/var/www/test/';
root $root_path;
location /static/ {
root /var/www/cd.stroum.ga/project;
expires 3d;
access_log off;
#add_header Cache-Control public;
add_header Cache-Control public,max-age=259200;
break;
}
location "/" {
proxy_pass http://127.0.0.1:8000/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}