This repository has been archived on 2025-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
goaccess-docker/root/opt/nginx.conf
2022-05-17 16:11:43 +01:00

47 lines
952 B
Nginx Configuration File

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";
}
}
}