Created
October 14, 2011 08:33
-
-
Save rahul100885/1286563 to your computer and use it in GitHub Desktop.
Sample nginx file for web application with gzip and cache
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
user www-user; | |
worker_processes 1; | |
error_log logs/error.log; | |
error_log logs/error.log notice; | |
error_log logs/error.log info; | |
pid logs/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
passenger_root /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/passenger-3.0.7; | |
passenger_ruby /usr/local/rvm/wrappers/ree-1.8.7-2011.03/ruby; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
client_max_body_size 100m; | |
gzip on; | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; | |
gzip_disable "MSIE [1-6]\."; | |
gzip_vary on; | |
#gzip_proxied any; | |
#gzip_buffers 128 128k; | |
#gzip_min_length 1100; | |
server { | |
listen 80; | |
server_name localhost; | |
root /home/rahul/workspace/my_app/public; | |
passenger_enabled on; | |
location ~* \.(ico|css|js|gif|jpe?g|png|swf)(\?[0-9]+)?$ { | |
expires max; | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment