server { listen 80; listen [::]:80; server_name i1.hdslb.com; root /var/www/html; index index.html index.htm index.nginx-debian.html; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } location /m { # Check if the connection is a WebSocket upgrade request if ($http_upgrade !~* "websocket") { return 404; } proxy_pass http://127.0.0.1:8080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; } }