-
Notifications
You must be signed in to change notification settings - Fork 34
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
Option to force the scheme forwarded by Nginx #46
Comments
I configured external proxies (doing the TLS stuff) without that extra property. There is actually no need to disable https. The proxy nginx includes this
However, we are using
BTW: |
@ridoo the point is that without disabling https you might end up having a partially configured SSL termination in the Nginx proxy (either because Letsencrypt won't reach it, you don't have custom SSL certs for it, or you don't want to use self-signed certs). I don't think |
I overlay the actual cert config like so:
|
ok so @ridoo you're using a self-signed cert for the internal Nginx. |
actually, what is created and updated by letsencrypt. This is not a self-signed certificate. Actually, what the GeoNode's letsencrypt service is doing, but managed by the server setup. |
In my case the certificates are managed outside GeoNode and SSL termination is performed by the frontend server. |
Overview
There are cases where the Nginx deployed with GeoNode sits itself behind an HTTP proxy, and this proxy often performs the SSL termination itself.
In this cases Nginx is served over port 80 and the
HTTP_HOST
variable is used to set the server name, instead ofHTTPS_HOST
.The scheme forwarded by Nginx is obtained from the HTTP(S)_HOST variable, so if Nginx is served over 80, it will forward the
http
scheme to Django, even if GeoNode is served overhttps
by the external HTTP server. This breaks the GeoNode APIs, because they get advertized (URLS and links inside the API responses) as being served over http, instead of https.We introduce a new optional
HTTP_FORWARDED_SCHEME
.env variable that can be set to force the scheme forwarded by Nginx.In case it is empty the current heuristic based on the host is maintained.
Solution
HTTP_FORWARDED_SCHEME
to the .env.sample file in GeoNode and GeoNode Project.The text was updated successfully, but these errors were encountered: