Open robbietjuh opened 7 years ago
I'm having this very same problem. I'm using uwsgi==2.0.15
+1 using 2.0.15
, tried all kinds of headers. Content-Type
was the only one that worked, all others were seemingly ignored. Also tried both --http
and --http-socket
.
Here's an easy test with the router_redirect
plugin (should redirect all requests that don't have the header X-Test: test
):
uwsgi --plugins=router_redirect --processes=1 --http-socket=0.0.0.0:80 --collect-header="X-Test TEST" --route-if-not='equal:${TEST};test redirect-permanent:https://${HTTP_HOST}/header=${TEST}'
And with curl:
❯ curl http://127.0.0.1:8088/ -Iv -H "X-Test: http"
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8088 (#0)
> HEAD / HTTP/1.1
> Host: 127.0.0.1:8088
> User-Agent: curl/7.54.0
> Accept: */*
> X-Test: http
>
< HTTP/1.1 301 Moved Permanently
HTTP/1.1 301 Moved Permanently
< Location: http://127.0.0.1:8088/header=
Location: http://127.0.0.1:8088/header=
<
* Excess found in a non pipelined read: excess = 17 url = / (zero-length body)
* Connection #0 to host 127.0.0.1 left intact
Should be redirecting to http://127.0.0.1:8088/header=http
.
I have ran into the same issue and after a short investigation I have found that it happens with uwsgi built without pcre support. You should install libpcre headers package and rebuild uwsgi or find prebuilt version with pcre support. I hope it helps somebody and it looks like that issue could be closed.
I've been scratching my head for a few hours on this one and I'm about to believe that this might be a bug. I have the following configuration snippet:
The following is logged, indicating that these rules are successfully getting applied:
However, it seems the rules are not working:
I've tested this with the latest uWSGI build and the default profile. I'm using the php plugin and a very simple
header('X-Sendfile: test');
to test it out.Let me know if you need any more info. I'd be glad to help out.