forked from eros/curltastic
70 lines
1.9 KiB
Nginx Configuration File
70 lines
1.9 KiB
Nginx Configuration File
worker_processes auto;
|
|
pid /tmp/nginx.pid;
|
|
error_log /dev/stderr warn;
|
|
|
|
events { worker_connections 1024; }
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
access_log /dev/stdout;
|
|
server_tokens off;
|
|
sendfile on;
|
|
client_body_temp_path /tmp/client_temp;
|
|
proxy_temp_path /tmp/proxy_temp;
|
|
fastcgi_temp_path /tmp/fastcgi_temp;
|
|
uwsgi_temp_path /tmp/uwsgi_temp;
|
|
scgi_temp_path /tmp/scgi_temp;
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
# Re-resolve the private service after Compose watch replaces its container.
|
|
resolver 127.0.0.11 valid=5s ipv6=off;
|
|
|
|
server {
|
|
listen 8080;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
client_max_body_size 16k;
|
|
set $curltastic_backend curltastic-backend:3000;
|
|
|
|
location = /healthz {
|
|
access_log off;
|
|
default_type text/plain;
|
|
return 200 "ok\n";
|
|
}
|
|
|
|
# Traefik removes /curltastic before these requests reach nginx.
|
|
location = /ws {
|
|
proxy_pass http://$curltastic_backend$request_uri;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_read_timeout 3600s;
|
|
proxy_send_timeout 3600s;
|
|
proxy_buffering off;
|
|
}
|
|
|
|
location = /room {
|
|
proxy_pass http://$curltastic_backend$request_uri;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Connection "";
|
|
}
|
|
|
|
location /assets/ {
|
|
try_files $uri =404;
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
}
|
|
}
|