Files
openfreemap/ssh_lib/assets/nginx/nginx.conf
Zsolt Ero af3338fc80 nginx
2023-12-29 04:02:58 +01:00

72 lines
1.7 KiB
Nginx Configuration File

user nginx;
pid /var/run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 300000; # needs to be < ulimit -n
error_log /data/nginx/logs/nginx-error.log warn;
events {
worker_connections 40000;
multi_accept on;
}
http {
# aggressive caching for read-only sources
open_file_cache max=1000000 inactive=60m;
open_file_cache_valid 60m;
open_file_cache_min_uses 1;
open_file_cache_errors on;
server_tokens off;
include /etc/nginx/mime.types;
types {
application/vnd.mapbox-vector-tile pbf;
}
default_type application/octet-stream;
charset utf-8;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
reset_timedout_connection on;
send_timeout 20;
max_ranges 0;
gzip on;
gzip_comp_level 1;
gzip_types application/json;
log_format access_json '{'
'"time": "$time_iso8601", '
'"msec": "$msec", '
'"status": $status, '
'"request": "$request", '
'"request_method": "$request_method", '
'"request_time": $request_time, '
'"body_bytes_sent": $body_bytes_sent, '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"http_referrer": "$http_referer", '
'"http_x_forwarded_for": "$http_x_forwarded_for", '
'"http_user_agent": "$http_user_agent", '
'"host": "$host", '
'"uri": "$uri", '
'"http_cf_connecting_ip": "$http_cf_connecting_ip", '
'"http_cf_ray": "$http_cf_ray", '
'"http_cf_ipcountry": "$http_cf_ipcountry", '
'"scheme": "$scheme", '
'"http_host": "$http_host"'
'}';
access_log /data/nginx/logs/nginx-access.log access_json buffer=32k;
include /data/nginx/config/*;
include /data/nginx/sites/*;
}