mirror of
https://github.com/rommapp/romm.git
synced 2026-11-29 01:58:41 +01:00
open_file_cache keyed descriptors by path, so a cover replaced via os.replace() kept serving the old inode until the validity window expired, and the ?ts= buster does not change the filesystem key. The comment beside it claimed the opposite. The benefit was never measured either: the cache saves an open() and an fstat() per request, which is microseconds on a local file, and covers are served immutable so repeat hits are rare. Removing it is simpler than scoping it away from the one tree it was supposed to help. The keepalive test asserted gunicorn outlives nginx's idle timeout without checking that nginx pools upstream connections at all, which it only does by default from 1.29.7, so a downgrade would have left the test green and the pooling silently gone. It now checks the pinned version too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HDXxq3vAxJVGhm1pQuK8V7
87 lines
2.8 KiB
Plaintext
87 lines
2.8 KiB
Plaintext
load_module modules/ngx_http_js_module.so;
|
|
load_module modules/ngx_http_zip_module.so;
|
|
|
|
worker_processes auto;
|
|
pid /tmp/nginx.pid;
|
|
|
|
events {
|
|
worker_connections 2048;
|
|
multi_accept on;
|
|
}
|
|
|
|
http {
|
|
client_body_temp_path /tmp/client_body 1 2;
|
|
fastcgi_temp_path /tmp/fastcgi 1 2;
|
|
proxy_temp_path /tmp/proxy;
|
|
uwsgi_temp_path /tmp/uwsgi;
|
|
scgi_temp_path /tmp/scgi;
|
|
|
|
sendfile on;
|
|
client_body_buffer_size 128k;
|
|
client_max_body_size 0;
|
|
client_header_buffer_size 1k;
|
|
large_client_header_buffers 4 16k;
|
|
send_timeout 600s;
|
|
keepalive_timeout 600s;
|
|
client_body_timeout 600s;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3; # Dropping SSLv3/TLSv1/TLSv1.1, ref: POODLE
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
js_import /etc/nginx/js/decode.js;
|
|
|
|
map $time_iso8601 $date {
|
|
~([^+]+)T $1;
|
|
}
|
|
map $time_iso8601 $time {
|
|
~T([0-9:]+)\+ $1;
|
|
}
|
|
|
|
# Map to extract the browser name (e.g., Chrome, Firefox, etc.)
|
|
map $http_user_agent $browser {
|
|
default "Unknown";
|
|
"~Chrome/" "Chrome";
|
|
"~Firefox/" "Firefox";
|
|
"~Safari/" "Safari";
|
|
"~Edge/" "Edge";
|
|
"~Opera/" "Opera";
|
|
}
|
|
|
|
# Map to extract the OS (e.g., Windows, MacOS, Linux)
|
|
map $http_user_agent $os {
|
|
default "Unknown";
|
|
"~Windows NT" "Windows";
|
|
"~Macintosh" "macOS";
|
|
"~Linux" "Linux";
|
|
"~Android" "Android";
|
|
"~iPhone" "iOS";
|
|
}
|
|
|
|
#INFO: [nginx][2023-11-14 09:20:29] 127.0.0.1 - -"GET / HTTP/1.1" 500 177 "-" "Mozilla/5.0 (X11; Linux x86_64)"rt=0.000 uct="-" uht="-" urt="-"
|
|
log_format romm_logs 'INFO: [RomM][nginx][$date $time] '
|
|
'$remote_addr | $http_x_forwarded_for | '
|
|
'$request_method $request_uri $status | $body_bytes_sent | '
|
|
'$browser $os | $request_time';
|
|
|
|
access_log /dev/stdout romm_logs buffer=32k flush=5s;
|
|
error_log /dev/stderr;
|
|
|
|
gzip on;
|
|
gzip_proxied any;
|
|
gzip_vary on;
|
|
gzip_comp_level 6;
|
|
gzip_buffers 16 8k;
|
|
gzip_min_length 1024;
|
|
gzip_http_version 1.1;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/wasm image/svg+xml;
|
|
|
|
# The `wsgi_server` upstream is defined in a templated conf.d file so its
|
|
# port can track ${DEV_PORT} via envsubst (nginx.conf is not templated).
|
|
include /etc/nginx/conf.d/*.conf;
|
|
}
|