GeoNode / geonode-project

A django template project for creating custom GeoNode projects.
http://geonode.org
78 stars 172 forks source link

3.3.X Branch - UWSGI Proxy issue #361

Closed sonicnkt closed 2 years ago

sonicnkt commented 2 years ago

The default config/template of the 3.3.x branch wont result in a working setup. There is an issue with nginx not being able to proxy to the django container using uwsgi:

2022/08/09 11:52:27 [error] 21#21: *2 upstream prematurely closed connection while reading response header from upstream, client: 172.18.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "uwsgi://172.18.0.5:8000", host: "localhost"

Since i was able to connect to django container directly from the host using the mentioned ip and port in error log, i first checked the nginx config and replacing uwsgi_pass $upstream;with proxy_pass http://$upstream;fixed the issue. Tho i bet there was a reason to use uwsgi.

Since the master/4.X Branch worked fine i checked the latest commits and found: https://github.com/GeoNode/geonode-project/commit/a74f55ea4b00d9bcf4291a7ddbb75ceed2071c2c . This one wasn't merged into the 3.3.X branch so i applied the changes to geonode.confand uwsgi.inimanually and this fixed the issue in 3.3.x as well.

The main culprit is in the ./src/uwsgi.ini. the 3.3.x one uses http_socket instead of socket and this results in nginx not being able to connect using uwsgi_pass.