Created
August 1, 2012 10:37
-
-
Save gerhard/3225704 to your computer and use it in GitHub Desktop.
Preventing nginx from adding the trailing slash onto subdirs
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 { | |
... | |
# asset files (.css, .js, .png etc.) are not served correctly... | |
location /developer { | |
rewrite /(.*)/? /$1/index.html break; | |
root /mnt/www/docs/public; | |
} | |
# ... so they get a separate entry | |
# Being a more specific match, nginx uses this one for assets. | |
location /developer/assets { | |
root /mnt/www/docs/public; | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Want to avoid
if
conditions...