Everything :)

This commit is contained in:
2022-05-17 16:11:43 +01:00
parent b78e7a0118
commit e7d68c294c
6 changed files with 910 additions and 80 deletions

46
root/opt/nginx.conf Normal file
View File

@@ -0,0 +1,46 @@
pid /tmp/nginx.pid;
error_log /dev/null;
events {
worker_connections 1024;
}
http {
index index.html;
access_log off;
map $http_upgrade $type {
websocket "socket";
default "web";
}
server {
listen 7889 default_server;
server_name _;
root /config/html;
index index.html;
access_log off;
location / {
try_files /nonexistent @$type;
}
location @web {
sub_filter 'WebSocket(str)' 'WebSocket(window.location.href.split("#")[0].replace(window.location.protocol, window.location.protocol == "https:" ? "wss://" : "ws://"))';
sub_filter_once on;
try_files $uri $uri/ =404;
}
location @socket {
proxy_pass http://localhost:7890;
proxy_connect_timeout 1d;
proxy_send_timeout 1d;
proxy_read_timeout 1d;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
}