70 lines
1.7 KiB
Nginx Configuration File
70 lines
1.7 KiB
Nginx Configuration File
# /etc/nginx/nginx.conf
|
|
|
|
user root;
|
|
|
|
# Do not start as daemon
|
|
daemon off;
|
|
|
|
worker_processes auto;
|
|
worker_rlimit_nofile 100000;
|
|
|
|
# Set log to stderr
|
|
error_log stderr warn;
|
|
pid /var/run/nginx.pid;
|
|
|
|
include /etc/nginx/modules/*.conf;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
server_tokens off;
|
|
keepalive_timeout 15;
|
|
sendfile on;
|
|
tcp_nodelay on;
|
|
|
|
log_format custom_log '[$time_local] [NGINX] - $remote_addr - $remote_user - '
|
|
'"$request" $status $body_bytes_sent '
|
|
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
|
|
|
|
# Do not log access
|
|
access_log /dev/stdout custom_log;
|
|
|
|
# SSL
|
|
ssl_prefer_server_ciphers on;
|
|
ssl_session_cache shared:SSL:2m;
|
|
|
|
# buffering causes issues, disable it
|
|
# increase buffer size. still useful even when buffering is off
|
|
proxy_buffering off;
|
|
proxy_buffer_size 4k;
|
|
|
|
# Buffer size
|
|
client_body_buffer_size 10k;
|
|
client_header_buffer_size 1k;
|
|
client_max_body_size 8m;
|
|
large_client_header_buffers 2 1k;
|
|
|
|
# Timeouts
|
|
client_body_timeout 12;
|
|
client_header_timeout 12;
|
|
send_timeout 10;
|
|
|
|
# GZip Compression
|
|
gzip on;
|
|
gzip_http_version 1.0;
|
|
gzip_vary on;
|
|
gzip_comp_level 4;
|
|
gzip_min_length 1280;
|
|
gzip_buffers 128 4k;
|
|
# gzip_proxied expired no-cache no-store private auth;
|
|
gzip_proxied any;
|
|
gzip_disable "msie6";
|
|
# gzip_types text/plain application/x-javascript text/xml text/css application/xml;
|
|
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/bmp;
|
|
|
|
include /etc/nginx/conf.d/*.conf;
|
|
} |