2017-12-20 18:02:37 -05:00
# run nginx in foreground
daemon off ;
user root ;
# Set number of worker processes automatically based on number of CPU cores.
worker_processes auto ;
# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on ;
2018-07-31 01:18:09 -04:00
error_log /data/logs/error.log warn ;
2017-12-20 18:02:37 -05:00
# Includes files with directives to load dynamic modules.
include /etc/nginx/modules/*.conf ;
events {
worker_connections 1024 ;
}
http {
2019-03-14 17:49:08 -04:00
include /etc/nginx/mime.types ;
default_type application/octet-stream ;
sendfile on ;
server_tokens off ;
tcp_nopush on ;
tcp_nodelay on ;
client_body_temp_path /tmp/nginx/body 1 2 ;
keepalive_timeout 65 ;
ssl_prefer_server_ciphers on ;
gzip on ;
proxy_ignore_client_abort off ;
client_max_body_size 2000m ;
server_names_hash_bucket_size 64 ;
proxy_http_version 1 .1 ;
proxy_set_header X-Forwarded-Scheme $scheme ;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
proxy_set_header Accept-Encoding "" ;
proxy_cache off ;
proxy_cache_path /var/lib/nginx/cache/public levels=1:2 keys_zone=public-cache:30m max_size=192m ;
proxy_cache_path /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m ;
2017-12-20 18:02:37 -05:00
# MISS
# BYPASS
# EXPIRED - expired, request was passed to backend
# UPDATING - expired, stale response was used due to proxy/fastcgi_cache_use_stale updating
# STALE - expired, stale response was used due to proxy/fastcgi_cache_use_stale
# HIT
# - (dash) - request never reached to upstream module. Most likely it was processed at Nginx-level only (e.g. forbidden, redirects, etc) (Ref: Mail Thread
log_format proxy '[ $time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host " $request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] " $http_user_agent" " $http_referer"' ;
2018-08-23 00:24:28 -04:00
log_format standard '[ $time_local] $status - $request_method $scheme $host " $request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] " $http_user_agent" " $http_referer"' ;
2017-12-20 18:02:37 -05:00
2018-07-31 01:18:09 -04:00
access_log /data/logs/default.log proxy ;
2017-12-20 18:02:37 -05:00
2018-10-19 02:24:44 -04:00
# Dynamically generated resolvers file
include /etc/nginx/conf.d/include/resolvers.conf ;
2018-12-11 18:47:12 -05:00
# Default upstream scheme
map $host $forward_scheme {
default http ;
}
2019-01-02 17:18:48 -05:00
# Real IP Determination
# Docker subnet:
set_real_ip_from 172 .0.0.0/8 ;
# NPM generated CDN ip ranges:
include conf.d/include/ip_ranges.conf ;
# always put the following 2 lines after ip subnets:
real_ip_header X-Forwarded-For ;
real_ip_recursive on ;
2018-10-19 02:24:44 -04:00
# Files generated by NPM
2017-12-20 18:02:37 -05:00
include /etc/nginx/conf.d/*.conf ;
2019-03-04 06:19:36 -05:00
include /data/nginx/default_host/*.conf ;
2018-08-01 07:18:17 -04:00
include /data/nginx/proxy_host/*.conf ;
include /data/nginx/redirection_host/*.conf ;
include /data/nginx/dead_host/*.conf ;
2019-08-17 05:01:00 -04:00
include /data/nginx/temp/*.conf ;
2019-08-08 21:19:42 -04:00
# Custom
include /data/nginx/custom/http[.]conf ;
2017-12-20 18:02:37 -05:00
}
2018-02-16 01:57:54 -05:00
stream {
2018-10-19 02:24:44 -04:00
# Files generated by NPM
2018-07-31 01:18:09 -04:00
include /data/nginx/stream/*.conf ;
2018-02-16 01:57:54 -05:00
}
2018-07-31 01:18:09 -04:00
2019-08-08 21:19:42 -04:00
# Custom
include /data/nginx/custom/root[.]conf ;