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

Trouble with Django paths when using Apache proxy #4510

Closed
rumski20 opened this issue Jun 13, 2019 · 4 comments
Closed

Trouble with Django paths when using Apache proxy #4510

rumski20 opened this issue Jun 13, 2019 · 4 comments
Labels
docker Issues specific to GeoNode docker or GeoNode SPC wontfix Stale Bot: Stale issue
Milestone

Comments

@rumski20
Copy link

I have downloaded and built the docker containers using the instructions provided here: (https://github.com/GeoNode/geonode/tree/master/scripts/spcgeonode)
The containers eventually get up and running just fine.

I have Apache on the Ubuntu host acting as a proxy that forwards requests to the appropriate port that the container is listening on.
Example Apache configuration:
ProxyPass /geonode http://0.0.0.0:1234
ProxyPassReverse /geonode http://0.0.0.0:1234
This port is also specified in the .env file:
HTTP_HOST=myhost.com
HTTP_PORT=1234

I can navigate to myhost.com/geonode just fine, but the Django resources are returning 404 Not Found errors. They are trying to reference myhost.com/static/.... But shouldn't they be at myhost.com/geonode/static/...?

Is there a setting I missed in the.env file or maybe something I need to change in the docker-compose.yml file?
Thank you for any advice you have on how to set up this arrangement. Thank you also for doing all the work to provide this amazing arrangement.

Specifications

@rumski20
Copy link
Author

Seems related to this issue: #4113 but is the solution by @afabiani there still the recommended one? (I hope not because I need to use Apache on my host).

@t-book t-book added the docker Issues specific to GeoNode docker or GeoNode SPC label Jun 13, 2019
@t-book
Copy link
Contributor

t-book commented Jun 14, 2019

@rumski20
What if you just redirect the static folder in your proxy (apache vhost)

RewriteEngine On
RewriteRule ^static/(.+)$ /geonode/static/$1 [L,NC]

@rumski20
Copy link
Author

Thanks for the suggestion, @t-book . I actually got the django resources to show up by editing the static and media URLs in the docker-compose.yml file.
eg. STATIC_URL=geonode/static/
However, other URL endpoints are not showing correctly such as myhost.com/geonode/people. I wonder will I have to use the tactic you suggested above for each of these paths or is there a way to set an environment variable somewhere that should take care of mapping these correctly?

Thanks for any help you can provide.

@afabiani afabiani added this to the 2.10.1 milestone Jul 11, 2019
@stale
Copy link

stale bot commented Sep 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Stale Bot: Stale issue label Sep 9, 2019
@stale stale bot closed this as completed Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Issues specific to GeoNode docker or GeoNode SPC wontfix Stale Bot: Stale issue
Projects
None yet
Development

No branches or pull requests

3 participants