mirror of
https://github.com/thilo-behnke/wasm-pong.git
synced 2026-07-12 02:59:48 +00:00
52 lines
1.2 KiB
Plaintext
52 lines
1.2 KiB
Plaintext
upstream api_server {
|
|
server ${API_SERVER}:4000;
|
|
}
|
|
|
|
upstream web_client {
|
|
server localhost:8080;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
ssl_ciphers AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5;
|
|
ssl_certificate /etc/ssl/wasm-pong.pem;
|
|
ssl_certificate_key /etc/ssl/private.key;
|
|
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
root /usr/share/nginx;
|
|
|
|
location = / {
|
|
return 301 /pong/web;
|
|
}
|
|
|
|
location /pong/web/ {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location /pong/api/ {
|
|
proxy_pass http://api_server/;
|
|
|
|
proxy_redirect off;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Host $server_name;
|
|
}
|
|
|
|
location /pong/ws {
|
|
proxy_pass http://api_server/ws;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|