Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite/set order issue #120

Open
jprelph opened this issue Sep 20, 2018 · 0 comments
Open

Rewrite/set order issue #120

jprelph opened this issue Sep 20, 2018 · 0 comments

Comments

@jprelph
Copy link

jprelph commented Sep 20, 2018

Due to the use of set in regards to 'set $upstream_backend' there's an issue adding rewrite rules in using the ADD_NGINX_LOCATION_CFG as this breaks, for instance adding rewrite ^/path(.*) $1 break to remove the location will cause proxy_pass to break.

Changing the order of the rewrite module directives works, so an ADD_NGINX_LOCATION_CFG set to set $backend_upstream 'https://example.com'; rewrite ^/path(.*) $1 break does work.

While this is a valid workaround I think it's hard to discover - there's a few ways I can see to fix this - either moving set $backend_upstream "$proxy_address"; out of the template and inserting that before ${ADD_NGINX_LOCATION_CFG} in enable_location.sh (ie. so it appears before any added config) or creating a new ADD_REWRITE variable that could be added after the set $backend_upstream directive.

Happy to do a PR for either but I wasn't sure which was preferable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant