Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #----------------------------------------------------------------------
- # Main Module - directives that cover basic functionality
- #----------------------------------------------------------------------
- user nginx;
- # This number should be, at maximum, the number of CPU cores on your system.
- # (since nginx doesn't benefit from more than one worker per CPU.)
- worker_processes 24;
- # Number of file descriptors used for Nginx. This is set in the OS with 'ulimit -n 200000'
- worker_rlimit_nofile 200000;
- #error_log /var/log/nginx/error.log;
- error_log /dev/null crit;
- pid /var/run/nginx.pid;
- #----------------------------------------------------------------------
- # Events Module
- #----------------------------------------------------------------------
- events {
- # determines how many clients will be served by each worker process.
- # (Max clients = worker_connections * worker_processes)
- worker_connections 45000;
- # essential for linux, optmized to serve many clients with each thread
- use epoll;
- # accept as many connections as possible, after nginx gets notification about a new connection.
- # May flood worker_connections, if that option is set too low.
- multi_accept on;
- }
- #----------------------------------------------------------------------
- # HTTP Core Module
- #----------------------------------------------------------------------
- http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
- # caches information about open FDs and freqently accessed files
- open_file_cache max=200000 inactive=20s;
- open_file_cache_valid 30s;
- open_file_cache_min_uses 2;
- open_file_cache_errors on;
- # Buffer log writes to speed up IO.
- #access_log /var/log/nginx/access.log main buffer=16k;
- access_log off;
- # Sendfile copies data between one FD and other from within the kernel.
- # More efficient than read() + write(), since the requires transferring data to and from the user space.
- # Tcp_nopush causes nginx to attempt to send its HTTP response head in one packet,
- # instead of using partial frames. This is useful for prepending headers before calling sendfile,
- # or for throughput optimization.
- sendfile on;
- tcp_nopush on;
- # -- keep-alive options --#
- # don't buffer data-sends (disable Nagle algorithm). Good for sending frequent small bursts of data in real time.
- tcp_nodelay on;
- # Timeout for keep-alive connections. Server will close connections after this time.
- keepalive_timeout 30;
- # Number of requests a client can make over the keep-alive connection.
- keepalive_requests 100000;
- # -- Timeouts -- #
- # allow the server to close the connection after a client stops responding. Frees up socket-associated memory.
- # Does not apply
- reset_timedout_connection on;
- # send the client a "request timed out" if the body is not loaded by this time. Default 60.
- client_body_timeout 10;
- # If the client stops reading data, free up the stale client connection after this much time. Default 60.
- send_timeout 2;
- # Compression. Useful for cutting down on network traffic
- gzip on;
- gzip_min_length 10240;
- gzip_proxied expired no-cache no-store private auth;
- gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
- gzip_disable "MSIE [1-6]\.";
- # -- The default server -- #
- server {
- listen 80;
- server_name _;
- location / {
- root /usr/share/nginx/html;
- index index.html index.htm;
- }
- error_page 404 /404.html;
- location = /404.html {
- root /usr/share/nginx/html;
- }
- # redirect server error pages to the static page /50x.html
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- }
- # Load config files from the /etc/nginx/conf.d directory
- #include /etc/nginx/conf.d/*.conf;
- }
Advertisement
Add Comment
Please, Sign In to add comment