--
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 pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/8736qbavgg.fsf%40metapensiero.it.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwF9YMW5dKZLeCz%3DLx4mR_wGvj2_AZBeXbtMgxGAhOxs0g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/52FD77F3-8DA3-4E7D-8CED-60BBC34F3C5D%400x58.com.
Please note that in the future Waitress is going to be more secure by default, and will strip known proxy headers before forwarding them on in the WSGI environ to help protect WSGI applications from accidentally using attacker provider proxy headers and their values.
It would be nice if that functionality could be implemented as middleware when not running the waitress server.
- if forwarded_host:
-
- forwarded_host = forwarded_host.strip()
# might be better as...
+ forwarded_host = forwarded_host.strip()
+ if forwarded_host:
[server:main]use = egg:waitress#mainhost = 127.0.0.1port = 5020trusted_proxy = 127.0.0.1
trusted_proxy_headers = x-forwarded-for x-forwarded-host x-forwarded-proto x-forwarded-port
On Jan 7, 2019, at 16:29, Jonathan Vanasco <jona...@findmeon.com> wrote:
On Monday, January 7, 2019 at 5:00:43 PM UTC-5, Jonathan Vanasco wrote:It would be nice if that functionality could be implemented as middleware when not running the waitress server.
This release broke our dev systems from the wsgi manipulation. The issue was this line to the nginx config from the instructions:proxy_set_header X-Forwarded-Host $host:$server_port;While the the `:$server_port` bit appears in many tutorials and docs on some projects, it isn't part of a standard or a standard/requirement. Even nginx's official docs has conflicting usage patterns with it:
* https://www.nginx.com/resources/wiki/start/topics/examples/likeapache/
* https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/
I can't tell if that bit was required by your code. It doesn't look like it is required (via `task.py` lines 531+) but perhaps a warning about that would help.Sidenote: it looks like the strip on line 680 may be better placed just above the immediate conditional- if forwarded_host:
-
- forwarded_host = forwarded_host.strip()
# might be better as...
+ forwarded_host = forwarded_host.strip()
+ if forwarded_host:
My initial feeling on this release is that I dislike this implementation. This approach will create a lot of added complexity for those who use waitress for Pyramid in development BUT run other servers in Production and/or Staging - we now have to deal with a deploying something where Waitress inherently takes control of this portion of wsgi manipulation in one environment, but is not run at all in other environments.
IMHO, it would be really nice if...
1. this happened within Pyramid (not likely to happen, I know)
or
2. this functionality were exposed as a callable, so other deployments can invoke it. This will still create some pain in maintaining dual deployment logics, but invoking waitress's logic would ensure parity.
Finally...
for the docs... if using an ini file, the syntax is;[server:main]use = egg:waitress#mainhost = 127.0.0.1port = 5020trusted_proxy = 127.0.0.1
trusted_proxy_headers = x-forwarded-for x-forwarded-host x-forwarded-proto x-forwarded-portusing a quoted format from the current docs will generate an error:
--
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 pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/01761583-c857-412f-80c3-117c6af4f82c%40googlegroups.com.
On Jan 7, 2019, at 17:18, Bert JW Regeer <xist...@0x58.com> wrote:On Jan 7, 2019, at 16:29, Jonathan Vanasco <jona...@findmeon.com> wrote:
On Monday, January 7, 2019 at 5:00:43 PM UTC-5, Jonathan Vanasco wrote:It would be nice if that functionality could be implemented as middleware when not running the waitress server.
This release broke our dev systems from the wsgi manipulation. The issue was this line to the nginx config from the instructions:proxy_set_header X-Forwarded-Host $host:$server_port;While the the `:$server_port` bit appears in many tutorials and docs on some projects, it isn't part of a standard or a standard/requirement. Even nginx's official docs has conflicting usage patterns with it:$server_port is only required if you are not using a default port, so that the `X-Forwarded-Host` contains the port number. Browsers by default will already send a host header like this:Host: example.com:8080If the URL is:I am not sure if NGINX forwards the port with the host in the $host variable or not. I can remove it from the docs.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CC8D499E-7ADE-46DA-B9D9-DD198F2B93F9%400x58.com.