-
-
Save tobsn/f6a301c441b67fe883b7 to your computer and use it in GitHub Desktop.
nginx - sub_filter replace head with the current folder as base href for sub project folder structure
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 / { | |
if ($uri ~* ^/([^.\?/]+)) { | |
set $foldername "$1"; | |
} | |
sub_filter "<head>" "<head><base href=\"${scheme}://${host}/${foldername}/\">"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment