Last active
February 5, 2016 10:29
-
-
Save sofianhw/bf206e95061bcc03beb8 to your computer and use it in GitHub Desktop.
Nginx configuration for static content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
root /var/www/html/data; | |
location /images/ { | |
#Enabling the sendfile directive will eliminate the step of copying the data into the buffer and enables direct copying data from one file descriptor to anothers | |
sendfile on; | |
#To prevent one fast connection to entirely occupy the worker process, you can limit the amount of data transferred in a single sendfile() call by defining the sendfile_max_chunk directive | |
sendfile_max_chunk 1m; | |
#Use the tcp_nopush option together with sendfile on;. The option will enable NGINX to send HTTP response headers in one packet right after the chunk of data has been obtained by sendfile | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo sysctl -w net.core.somaxconn=4096