Closed tmplt closed 8 years ago
Where can I change this?
pb calculates this from incoming request headers. You can also use flask-specific config options, but I don't suggest doing this.
using nginx as a reverse proxy
So nginx is the thing connecting to pb/uwsgi here?
You should add:
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;
To whatever block your proxy_pass
directive is in.
The X-Forwarded-Proto
stuff is from pb.util.absolute_url
and the Host
logic is somewhere several levels deep in that call stack. In theory, the host header should be X-Forwarded-Host
, but that's more a flask/werkzeug bug than a pb problem I'd have to monkey with the app-level url_adapter
to make that work, which is how _scheme
works internally. Flask is completely shit. Blame @silverp1 for that design choice :smile:
VARNISH_BASE
Is used for cache invalidation; you should probably remove that from your config if you don't have a validly configured varnish server there.
My nginx.conf
now contains:
location / {
proxy_pass http://[::]:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;
}
and it works. Cheers!
and it works
Crazy how code does that.
I have deployed
pb
on my own server, and I'm usingnginx
as a reverse proxy. Currently, on the page itself, and when Ithe paste is created, but the
url
ishttp://[::]:8080/f5-D
instead ofhttps://paste.hostname.tld/f5-D
. Where can I change this?I assumed changing
VARNISH_BASE
in/etc/xdg/pb/config.yaml
would be it, but nothing changed after I restartedpb
.I am using the AUR package,
pb-git
.