41 lines
1.6 KiB
Plaintext
Executable File
41 lines
1.6 KiB
Plaintext
Executable File
# Example for nginx on the SAME host as loopback-bound node :3201.
|
|
# Not installed by this repository. Replace host/cert paths and validate real topology.
|
|
# Node: WIKIDECK_TRUSTED_PROXIES=127.0.0.1,::1 (never use this for a container bridge without adjustment).
|
|
limit_req_zone $binary_remote_addr zone=wikideck_ip:10m rate=5r/s;
|
|
limit_conn_zone $binary_remote_addr zone=wikideck_conn:10m;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name wikideck.example.invalid;
|
|
return 308 https://$host$request_uri;
|
|
}
|
|
server {
|
|
listen 443 ssl;
|
|
server_name wikideck.example.invalid;
|
|
ssl_certificate /etc/ssl/wikideck/fullchain.pem;
|
|
ssl_certificate_key /etc/ssl/wikideck/private.key;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
server_tokens off;
|
|
client_max_body_size 68k;
|
|
client_body_timeout 15s;
|
|
client_header_timeout 10s;
|
|
keepalive_timeout 10s;
|
|
send_timeout 30s;
|
|
limit_conn wikideck_conn 16;
|
|
limit_req_status 429;
|
|
# Do not proxy private operations listener. Its port must never be publicly published.
|
|
location / {
|
|
limit_req zone=wikideck_ip burst=20 nodelay;
|
|
proxy_pass http://127.0.0.1:3201;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
# Overwrite, do NOT append an untrusted client-supplied X-Forwarded-For chain.
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Forwarded "";
|
|
proxy_set_header Connection "";
|
|
proxy_connect_timeout 5s;
|
|
proxy_send_timeout 15s;
|
|
proxy_read_timeout 30s;
|
|
}
|
|
} |