forked from jpf/requestbin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
service.conf
46 lines (38 loc) · 1.1 KB
/
service.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
server {
listen 80 default;
client_max_body_size 4G;
charset utf-8;
server_name example.com;
server_tokens off;
access_log /var/log/nginx/prod.access.log;
error_log /var/log/nginx/prod.error.log warn;
add_header P3P 'CP="NON CURa ADMa DEVa PSAa PSDa IVAa IVDa OUR IND COM NAV STA"';
location /static {
alias /opt/code/static;
expires 12y;
log_not_found off;
}
location /robots.txt {
alias /var/www/robots.txt;
expires 12y;
log_not_found off;
}
location /index.html {
# try_files $uri /opt/code/templates/index.html;
root /opt/code/templates/;
}
location / {
# checks for static file, if not found proxy to app
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8000;
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /opt/code/templates/;
}
}