mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-26 01:24:59 +02:00
35 lines
1.0 KiB
Plaintext
35 lines
1.0 KiB
Plaintext
# Nginx API proxy compression baseline for WorldMonitor.
|
|
# Requires ngx_brotli (or Nginx Plus Brotli module) to be installed.
|
|
|
|
# Prefer Brotli for HTTPS clients and keep gzip as fallback.
|
|
brotli on;
|
|
brotli_comp_level 5;
|
|
brotli_min_length 1024;
|
|
brotli_types application/json application/javascript text/css text/plain application/xml text/xml;
|
|
|
|
gzip on;
|
|
gzip_comp_level 5;
|
|
gzip_min_length 1024;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_types application/json application/javascript text/css text/plain application/xml text/xml;
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name api.worldmonitor.local;
|
|
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:8787;
|
|
proxy_http_version 1.1;
|
|
|
|
# Preserve upstream compression behavior and pass through client preferences.
|
|
proxy_set_header Accept-Encoding $http_accept_encoding;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
# If upstream sends pre-compressed content, do not decompress.
|
|
gunzip off;
|
|
}
|
|
}
|