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

Add a section on how to run under a sub-dir #215

Merged
merged 1 commit into from
Oct 10, 2018

Conversation

archaeogeek
Copy link
Contributor

This adds the start of a section on how to run geohealthcheck under a sub-dir. It's taken me a while to figure out how to do this in my setup without changing any core code, using nginx and gunicorn, and the end solution was so simple that I thought it was worth contributing. Unfortunately I don't know how it would be done using any other webserver! I do wonder whether I should also contribute a section on how to run geohealthcheck using nginx and gunicorn anyway!

This adds the start of a section on how to run geohealthcheck under a sub-dir. It's taken me a while to figure out how to do this in my setup without changing any core code, using nginx and gunicorn, and the end solution was so simple that I thought it was worth contributing.  Unfortunately I don't know how it would be done using any other webserver! I do wonder whether I should also contribute a section on how to run geohealthcheck using nginx and gunicorn anyway!
@justb4 justb4 merged commit 83c1a3e into geopython:master Oct 10, 2018
@justb4
Copy link
Member

justb4 commented Oct 10, 2018

Thanks @archaeogeek, possibly you may add some extra wording: this issue has popped up in several deployment scenarios, like with Docker. There we usually refer to "running GHC with a sub-path" (i.s.o. subdir) or "running GHC on a subpath behind a proxy server". Like you (and we painstakingly) found out, the "secret" is using the SCRIPT_NAME environment variable at GHC's startup. This var is interpreted by Flask such that e.g. Jinja2 url_for() directives render correct paths.

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

Successfully merging this pull request may close these issues.

2 participants