infra/roles/stable/nginx/templates/reverse_proxy.conf.j2

34 lines
801 B
Text
Raw Normal View History

2020-11-21 23:42:08 +01:00
# 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}}
}
}