34 lines
801 B
Text
34 lines
801 B
Text
|
# nginx ssl file
|
||
|
|
||
|
server {
|
||
|
listen 80;
|
||
|
listen [::]:80;
|
||
|
server_name {{item.server_name}};
|
||
|
|
||
|
keepalive_timeout 200;
|
||
|
{{item.custom_config | default('') | indent(2)}}
|
||
|
|
||
|
location / {
|
||
|
proxy_pass {{item.proxy_pass}};
|
||
|
proxy_http_version 1.1;
|
||
|
|
||
|
# hide client ip to backend
|
||
|
proxy_set_header X-Real-IP 42.42.42.42;
|
||
|
|
||
|
# set host
|
||
|
proxy_set_header Host $host;
|
||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||
|
proxy_set_header X-Forwarded-Host $host;
|
||
|
proxy_set_header X-Forwarded-Port $server_port;
|
||
|
|
||
|
# upgrade websocket
|
||
|
proxy_set_header Upgrade $http_upgrade;
|
||
|
proxy_set_header Connection "upgrade";
|
||
|
|
||
|
# cache
|
||
|
# proxy_cache {{item.server_name}}
|
||
|
}
|
||
|
}
|
||
|
|