Created
November 11, 2014 22:54
-
-
Save llbbl/13594edde83da889603f to your computer and use it in GitHub Desktop.
common nginx conf for osx
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
# Global configuration file. | |
# ESSENTIAL : Configure Nginx Listening Port | |
listen 80; | |
# ESSENTIAL : Default file to serve. If the first file isn't found, | |
index index.php index.html index.htm; | |
# ESSENTIAL : no favicon logs | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
# ESSENTIAL : robots.txt | |
location = /robots.txt { | |
allow all; | |
log_not_found off; | |
access_log off; | |
} | |
# ESSENTIAL : Configure 404 Pages | |
error_page 404 /404.html; | |
# ESSENTIAL : Configure 50x Pages | |
error_page 500 502 503 504 /50x.html; | |
# SECURITY : Deny all attempts to access hidden files .abcde | |
location ~ /\. { | |
deny all; | |
} | |
# PERFORMANCE : Set expires headers for static files and turn off logging. | |
location ~* ^.+\.(js|css|swf|xml|txt|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { | |
access_log off; log_not_found off; expires 30d; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment