Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
user nobody;
worker_processes 1;
worker_rlimit_nofile 69152;
worker_shutdown_timeout 10s;
timer_resolution 1s;
thread_pool iopool threads=32 max_queue=65536;
pcre_jit on;
pid /var/run/nginx.pid;
error_log /var/log/nginx/error_log;
#Load Dynamic Modules
include /etc/nginx/modules.d/*.load;
events {
worker_connections 20480;
use epoll;
multi_accept on;
accept_mutex off;
}
http {
#sendfile
sendfile on;
sendfile_max_chunk 512k;
#asyncio
aio threads=iopool;
aio_write on;
directio 2m;
tcp_nodelay on;
keepalive_timeout 60;
types_hash_max_size 4096;
server_tokens off;
client_max_body_size 128m;
reset_timedout_connection on;
#FastCGI
fastcgi_read_timeout 300;
fastcgi_send_timeout 300;
#Proxy Buffer setting
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
# http2 timeout Settings
http2_idle_timeout 1m;
http2_recv_timeout 15s;
#
server_names_hash_max_size 2097152;
server_names_hash_bucket_size 128;
# Open File Cache
open_file_cache max=4096 inactive=5m;
open_file_cache_valid 5m;
open_file_cache_min_uses 2;
open_file_cache_errors on;
# Include maps
include /etc/nginx/conf.d/maps.conf;
server {
listen localhost:80 backlog=16384 reuseport deferred;
server_name localhost;
access_log off;
location / {
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_connect_timeout 30s;
proxy_pass http://127.0.0.1:9999;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /nginx_status {
stub_status on;
access_log off;
}
}
server {
listen xxxx:443 default_server ssl backlog=16384 reuseport deferred;
ssl_certificate /var/cpanel/ssl/cpanel/mycpanel.pem;
ssl_certificate_key /var/cpanel/ssl/cpanel/mycpanel.pem;
server_name _;
access_log off;
include /etc/nginx/conf.d/ErrorPages.conf;
location / {
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_connect_timeout 30s;
proxy_pass https://xxxxx:4430;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment