20 lines
851 B
Plaintext
20 lines
851 B
Plaintext
# Host nginx: proxy /chess/ to the chess API in the jail. Include inside the
|
|
# existing TLS server block, next to the security headers. Replace
|
|
# JAIL_IP:API_PORT with the values given to setup-jail.sh.
|
|
#
|
|
# chess-server trusts X-Real-IP only from the address in -trusted-proxies
|
|
# (TRUSTED_PROXIES in setup-jail.sh): the address this nginx uses to reach
|
|
# the jail. Do not forward X-Forwarded-For for rate limiting; its first entry
|
|
# is supplied by the client.
|
|
location /chess/ {
|
|
proxy_pass http://JAIL_IP:API_PORT/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
# Long-polling waits up to 30 seconds for a game update.
|
|
proxy_read_timeout 45s;
|
|
# Bound request bodies; API payloads are small JSON documents.
|
|
client_max_body_size 16k;
|
|
}
|