29 lines
925 B
Nginx Configuration File
29 lines
925 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
add_header X-Content-Type-Options nosniff always;
|
|
add_header X-Frame-Options DENY always;
|
|
# WS protocol upgrade; heartbeat every 20s keeps the tunnel live.
|
|
location = /api/ws {
|
|
proxy_pass http://server:8080;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_read_timeout 75s;
|
|
proxy_send_timeout 10s;
|
|
proxy_buffering off;
|
|
}
|
|
location /api/ {
|
|
proxy_pass http://server:8080;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
client_max_body_size 4m;
|
|
}
|
|
location / { try_files $uri $uri/ /index.html; }
|
|
location ~ /\. { deny all; }
|
|
}
|