Coolify routes to port 3000 when 'Ports exposes' is left blank, but nginx only listened on 80 - so Traefik found nothing and returned 502 while the container itself was healthy and passing its healthcheck. nginx now listens on both 80 and 3000, so the game is served whichever port the proxy routes to. README documents setting Ports exposes = 80.
37 lines
902 B
Nginx Configuration File
37 lines
902 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
# Coolify's default app port - serve the game there too so the proxy
|
|
# can route to 80 or 3000 and the site works either way
|
|
listen 3000;
|
|
listen [::]:3000;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
server_tokens off;
|
|
charset utf-8;
|
|
|
|
# The game is one file - never cache it, so a redeploy shows up at once
|
|
location = /index.html {
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location = /healthz {
|
|
access_log off;
|
|
default_type text/plain;
|
|
return 200 "ok\n";
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_comp_level 5;
|
|
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
|
|
}
|