GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.41k stars 1.11k forks source link

Reverse proxy error after migration to 4.3 #12316

Closed pchevali closed 3 weeks ago

pchevali commented 3 weeks ago

Hi,

My setup is based on geonode-project started with version 4.1 that was working fine with the following chain :

Traefik => NGinx => Django+Geoserver

I am using Traefik as reverse proxy and https frontend and nginx is just used as a http server ( and reverse proxy for geonode and geoserver) It was working fine until the migration. After the migration to the latest version I am having some trouble with some requests ( the upload interface partially works and layers are linked to the private geoserver adress).

I found out that calling the https://[serveraddress]/api/v2/ in the browser, results in scheme for endpoints in "http" instead of "https"

I understand that this setup is not the one that geonode is designed for. However I solved the problem by rolling back the changes in the uwsgi.ini file of this pull request :

https://github.com/GeoNode/geonode/commit/bd7115dd3042c68ee6227de2e87f84c6d9cfbfa9

In the description, the change seems associated to that :

UWSGI + NGINX

Enabled proxyPass instead of uwsgiPass because we set headers correctly in geonode.conf only with proxyPass

So I changed the the uwsgi to :

[uwsgi]
uwsgi-socket = 0.0.0.0:800
#http-socket = 0.0.0.0:8000

instead of

[uwsgi]
# uwsgi-socket = 0.0.0.0:8000
http-socket = 0.0.0.0:8000

I don't know if it's the right way to do, or maybe is there a reason for using the http-socket instead of the uwsgi socket.

Do you have any advise or suggestions ?

pchevali commented 3 weeks ago

Hi,

I solved my problem here, I had to change the nginx configuration, i use the nginx from the stack as the http server only ( no reverse proxy to geoserver behind another reverse proxy). So now traefik is handling geoserver reverse proxy as well as geonode. The http_socket path for uwsgi works as well but I just needed to remove all the header setting things.