1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00
webvirtcloud/conf/nginx/webvirtcloud.conf

60 lines
1.8 KiB
Text

# "https" from a TLS-terminating proxy in front of this nginx is kept; otherwise
# the scheme of this server is used. A client claiming https over plain HTTP
# only changes how its own request is handled (no redirect, secure cookies).
map $http_x_forwarded_proto $wvc_forwarded_proto {
default $scheme;
https https;
}
server {
listen 80;
#server_name webvirtcloud.example.com;
#access_log /var/log/nginx/webvirtcloud-access_log;
location /static/ {
alias /srv/webvirtcloud/staticfiles/;
expires max;
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $wvc_forwarded_proto;
proxy_connect_timeout 1800;
proxy_read_timeout 1800;
proxy_send_timeout 1800;
client_max_body_size 1024M;
}
location /novncd/ {
proxy_pass http://wsnovncd;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Serial console (socketiod). Disabled by default: socketiod does not
# authenticate connections yet. Uncomment only together with
# SERIAL_CONSOLE_ENABLED = True, and only on a trusted network.
#location /socket.io/ {
# proxy_pass http://wssocketiod;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
#}
location /websockify {
proxy_pass http://wsnovncd;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
upstream wsnovncd {
server 127.0.0.1:6080;
}
upstream wssocketiod {
server 127.0.0.1:6081;
}