WebFaction
Community site: login faq

Summary: I'm using a django app which proxies to tomcat app. The django session information needs to be forwarded to the tomcat app, and apparently this is not happening.

My current theory is that the webfaction frontend nginx is stripping session info from requests that pass through it.

My questions are:

  • is the webfaction frontend nginx completely transparent; i.e. does it pass on all session etc headers?
  • if not, is it possible to make it pass the headers required by geonode?
  • or is my understanding completely wrong?

My configuration is like this:

  1. Webfaction "application" running on a port, say 9999.
  2. Webfaction "website" serving this application on http://somedomain/ .
  3. Compile nginx to run on 9999.
  4. Compile uwsgi to run on 7777.
  5. Configure tomcat to run on 8888, serving the /geoserver/ webapp.
  6. Configure nginx to serve static files on /static/ and /uploaded/
  7. Configure nginx to proxy geoserver to tomcat
  8. Configure nginx to proxy / to uwsgi (django)

I can browse to geonode django on http://somedomain/ and log in as a django user. I can browse to geoserver tomcat on http://somedomain/geoserver/web/ and log in as tomcat user.

I can browse to http://somedomain/layers/ and see thumbnails of uploaded layers.

HOWEVER when I browse to a layer, tomcat logs a series of errors. E.g. when uploading 'antroad' for the second time:

org.geoserver.platform.ServiceException: Could not find layer geonode:antroad_2 WARN [geonode.security] - Error connecting to the GeoNode server for authentication purposes Caused by: java.io.IOException: GeoNode communication failed, status report is: 404, Not Found WARN [servlet.PageNotFound] - No mapping found for HTTP request with URI [/geoserver/geonode/antcliff_2/wms] in DispatcherServlet with name 'dispatcher'

These last errors repeat many times.

Here is my nginx config:

pid /home/.../geonode2_nginx/parts/nginx-geonode/nginx-geonode.pid; lock_file /home/.../geonode2_nginx/parts/nginx-geonode/nginx-geonode.lock; daemon off; events { worker_connections 1024; } http { server { listen 9999; access_log /home/.../logs/user/access_geonode2_nginx.log; error_log /home/.../logs/user/error_geonode2_nginx.log; # serve staticfiles location /static/ { include /home/.../geonode2_nginx/parts/nginx/conf/mime.types; alias /home/.../geonode2_static/; expires 7d; } # serve mediafiles, default 'uploaded' in GeoNode location /uploaded/ { alias /home/.../geonode2_upload/; expires 7d; } # geoserver proxy location /geoserver/ { proxy_pass http://127.0.0.1:8888/geoserver/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; } # gunicorn/uwsgi wsgi proxy location / { proxy_pass_header Server; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; proxy_connect_timeout 20; proxy_read_timeout 20; proxy_pass http://127.0.0.1:7777/; } } }

asked 09 May '14, 13:01

Jean Jordaan
431615
accept rate: 33%

edited 09 May '14, 13:06


The direct cause of the issue that I was experiencing was a configuration issue, addressed in the documentation patch: https://github.com/GeoNode/geonode/commit/cc732e0a73c6d04d8f57fdf376dfb9a9848abd86

permanent link

answered 26 May '14, 07:24

Jean Jordaan
431615
accept rate: 33%

is the webfaction frontend nginx completely transparent; i.e. does it pass on all session etc headers?

Yes, we do not strip out any request headers at the front end.

if not, is it possible to make it pass the headers required by geonode?

That should already be happening.

or is my understanding completely wrong?

I don't see anything in the error message you provided that mentions a missing header, but I don't really know anything about your application stack so maybe that's not significant.

permanent link

answered 09 May '14, 18:53

seanf
12.2k42136
accept rate: 37%

Thanks for the answer. I'll update if I get things to work.

(10 May '14, 08:15) Jean Jordaan
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186
×16
×4
×2

question asked: 09 May '14, 13:01

question was seen: 7,530 times

last updated: 26 May '14, 07:24

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM