Files
romm/docker/nginx/default.conf
Michael Manganiello 98254d50b8 misc: Use nginx templates to allow for environment variable usage
Using the `envsubst` command, we can replace environment variables in
the nginx template files. This allows for more flexibility when
configuring the nginx server.

The Docker image we use as base for Nginx does provide the
`20-envsubst-on-templates.sh` script that will replace environment
variables in the template files.

This change does not include any behavior change, but unblocks future
changes that require environment variables in the nginx configuration.
2025-02-18 22:36:51 -03:00

69 lines
2.1 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 768;
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 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, 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;
}
#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_log 'INFO: [nginx][$date $time] $remote_addr - $remote_user '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" '
'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
access_log /dev/stdout romm_log;
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;
upstream wsgi_server {
server unix:/tmp/gunicorn.sock;
}
include /etc/nginx/conf.d/*.conf;
}