events { } http { # this is required to proxy Grafana Live WebSocket connections. map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 443 default_server ssl http2; listen [::]:443 ssl http2; include conf.d/nginx.server_name.conf; include conf.d/nginx.prod.certificates.conf; auth_basic "Protected Site"; auth_basic_user_file /etc/nginx/.htpasswd; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; resolver 127.0.0.11 ipv6=off; location /zipkin { proxy_pass http://zipkin:9411/zipkin/; } location /grafana/ { proxy_set_header Host $http_host; proxy_pass http://grafana:3000/; # Auth by nginx proxy_set_header X-WEBAUTH-USER $remote_user; proxy_set_header Authorization ""; } # Proxy Grafana Live WebSocket connections. location /grafana/api/live { rewrite ^/grafana/(.*) /$1 break; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header Host $http_host; proxy_pass http://grafana:3000/; # Auth by nginx proxy_set_header X-WEBAUTH-USER $remote_user; proxy_set_header Authorization ""; } location ~ (/admin)(.*) { proxy_pass http://adminPanel:8080/admin$2; } # Public API location ~ (/serverInfo)(.*) { proxy_pass http://connectServer:8080/serverInfo$2; auth_basic off; } # Game Servers: location ~ (/gameServer/(\d+)(.*)) { proxy_pass http://gameServer$2:8080$1; } } }