openssl req -x509 -newkey rsa:4096 -keyout private.key -out cert.pem -days 365 -sha256 -nodes -subj "/C=US"/etc/letsencrypt/live/example.com/fullchain.pem/etc/letsencrypt/live/example.com/privkey.pemexample.com → 159.89.179.140$host and $request_uri are filled in by nginx for each requestserver {
listen 443 ssl;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/yourgame.me/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourgame.me/privkey.pem;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
}
}location /websocket {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}ws:// connection
const protocol = location.protocol === "https:" ? "wss://" : "ws://";
const socket = new WebSocket(protocol + location.host + "/websocket");http://localhost:8080 and on your deployed domainservices:
nginx:
image: nginx
ports:
- "8080:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.confSecure directive to your auth cookies