-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
80 lines (65 loc) · 1.95 KB
/
nginx.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
daemon off;
events {
worker_connections 4096;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
log_format elb_log '$proxy_protocol_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent "$http_referer" ' '"$http_user_agent"';
server {
listen 80 proxy_protocol;
real_ip_header proxy_protocol;
set_real_ip_from 0.0.0.0;
client_max_body_size 4G;
charset utf-8;
server_name opsolutely.com www.opsolutely.com test.opsolutely.com localhost;
server_tokens off;
access_log /var/log/nginx/nginx.log elb_log;
add_header P3P 'CP="NON CURa ADMa DEVa PSAa PSDa IVAa IVDa OUR IND COM NAV STA"';
location /ping {
access_log off;
return 200 'ok';
add_header Content-Type text/plain;
}
location /index.html {
include /etc/nginx/mime.types;
alias /opt/code/templates;
}
location /robots.txt {
alias /var/www/robots.txt;
expires 12y;
log_not_found off;
}
# this section is specific to the WebSockets proxying
location /socket.io {
include /etc/nginx/mime.types;
proxy_pass http://127.0.0.1:8000/socket.io;
proxy_redirect off;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location / {
include /etc/nginx/mime.types;
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_pass http://127.0.0.1:8000;
}
location /static {
include /etc/nginx/mime.types;
alias /opt/code/static;
}
error_page 500 502 503 504 /500.html;
location = /500.html {
include /etc/nginx/mime.types;
alias /opt/code/templates;
}
}
}