Created
July 23, 2011 09:45
-
-
Save huobazi/1101239 to your computer and use it in GitHub Desktop.
nginx css javascript image remove www
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
location ~* .(jpg|gif|png|js|css)$ { | |
if (-f $request_filename) { | |
expires max; | |
break; | |
} | |
} | |
remove www from url | |
if ($host ~* ^www\.(.*)) { | |
set $remove_www $1; | |
rewrite ^(.*)$ http://$remove_www$1 permanent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment