Last active
August 29, 2015 14:24
-
-
Save rkjha/7313c2822898c7203051 to your computer and use it in GitHub Desktop.
A sample nginx config for static websites.
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
server { | |
listen 80; | |
server_name www.example.com; | |
rewrite ^(.*) http://example.com$1 permanent; | |
} | |
server { | |
listen 80; | |
server_name example.com; | |
root /home/example_user/example.com/public; | |
# Cache static content | |
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { | |
expires 90d; | |
add_header Vary Accept-Encoding; | |
access_log off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment