Hi,
I'm trying to use pyramid_debugtoolbar with nginx and gunicorn, talking
on a unix domain socket. This makes an empty REMOTE_ADDR, and I wonder
how can I make pyramid_debugtoolbar work.
I checked that request.remote_addr is empty, while request.client_addr
contains my browser's IP address.
nginx.conf:
location /hello {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://unix:/tmp/gunicorn.hello.sock;
}
development.ini:
[app:main]
pyramid.includes = pyramid_debugtoolbar
debugtoolbar.hosts = 0.0.0.0/0 ::/0
[server:main]
use = egg:gunicorn#main
workers = 1
bind = unix:/tmp/gunicorn.hello.sock
Of course I use other means to restrict access (TLS client certificates
verified by nginx) to this application.
I also tried commenting out this 'if' in toolbar.py:
https://github.com/Pylons/pyramid_debugtoolbar/blob/master/pyramid_debugtoolbar/toolbar.py#L201
And that made debugtoolbar to appear as expected.
What is the correct way to set up pyramid_debugtoolbar with nginx and
gunicorn and unix domain sockets?
András
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/20170518174014.GC10414%40eik.bme.hu.
For more options, visit https://groups.google.com/d/optout.