Created
November 19, 2013 16:17
-
-
Save robinmonjo/7547907 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#user nginx; | |
# TODO(0): Changer welcome to nginx par Welcome to your app et si l'app n'exsite pas faire une erreur 500 | |
user root root; | |
error_log /var/log/nginx.error.log; | |
pid /var/run/nginx.pid; | |
#Config changes found here: http://stackoverflow.com/questions/7325211/tuning-nginx-worker-process-to-obtain-100k-hits-per-min | |
worker_processes 4; # 2*number of cpus | |
events { | |
worker_connections 19000; | |
} | |
worker_rlimit_nofile 20000; #each connection needs a filehandle (or 2 if you are proxying) | |
http { | |
default_type application/octet-stream; | |
include /etc/nginx/mime.types; | |
log_format main '$remote_addr - $remote_user [$time_local] $request ' | |
'"$status" $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for"'; | |
access_log /var/log/nginx.access.log main; | |
sendfile on; | |
keepalive_timeout 5; #that' another key - close live connections as early as possible or disable them completely | |
proxy_connect_timeout 30; | |
proxy_send_timeout 3600; | |
proxy_read_timeout 3600; | |
send_timeout 3600; | |
client_max_body_size 10m; | |
gzip on; | |
gzip_min_length 1100; | |
gzip_buffers 4 8k; | |
gzip_types text/plain application/xml application/json text/css application/javascript application/x-javascript; | |
server | |
{ | |
listen 80 default; | |
server_name localhost; | |
access_log /var/log/nginx/localhost.access.log; | |
location / { | |
root /var/www/nginx-default; | |
index index.html index.htm; | |
} | |
location /doc { | |
root /usr/share; | |
autoindex on; | |
allow 127.0.0.1; | |
deny all; | |
} | |
location /images { | |
root /usr/share; | |
autoindex on; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment