Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matthias-chlechowitz/8b1d2be2923af248dd0f2e2cb201437c to your computer and use it in GitHub Desktop.
Save matthias-chlechowitz/8b1d2be2923af248dd0f2e2cb201437c to your computer and use it in GitHub Desktop.
remove fragment from file path in nginx location block
call:
$domain/sym_assets/**/*.jpg
desired result:
$root_dir/path/on/server/**/*.jpg
$root is different than place on server
location ~ /sym_assets {
rewrite ^/sym_assets(/.*)$ $1 last;
root path/on/server/
try_files $uri $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment