Re: listen proxy_protocol and rewrite redirect scheme

2016-09-17 Thread adrhc
I'm sorry for the babble above but the source of errors are too many. The previous post the problem was php (e.g. phpMyAdmin). The final working setup: src/http/ngx_http_header_filter_module.c: #if (NGX_HTTP_SSL) if (c->ssl || port == 443) { *b->last++ ='s'; } #endif

Re: listen proxy_protocol and rewrite redirect scheme

2016-09-17 Thread adrhc
Hi, I'm sorry for the babble above but there are so many point of failure and the setup is so complex. Last problem was php (e.g. phpMyAdmin). Anyway now really works this way: src/http/ngx_http_header_filter_module.c: #if (NGX_HTTP_SSL) if (c->ssl || port == 443) { *b->last++ ='s'; } #endi

Re: listen proxy_protocol and rewrite redirect scheme

2016-09-17 Thread adrhc
Well, it works partially; sometimes (scarce cases) the redirect still uses http ... this happens even with: #if (NGX_HTTP_SSL) // if (c->ssl || port != 80) { *b->last++ ='s'; // } #endif Posted at Nginx Forum: https://forum.nginx.org/read.php?2,269623,269645#msg-269645

Re: listen proxy_protocol and rewrite redirect scheme

2016-09-17 Thread adrhc
Hi, I'm sorry but I mistakenly claimed to work the patch: #if (NGX_HTTP_SSL) if (c->ssl || port == 443) { *b->last++ ='s'; } #endif In order to work nginx needs this config: server { listen 127.0.0.1:443proxy_protocol; port_in_redirect

Re: listen proxy_protocol and rewrite redirect scheme

2016-09-17 Thread adrhc
Hi, thank you for the hints. Starting from you suggestion I modified src/http/ngx_http_header_filter_module.c like this: #if (NGX_HTTP_SSL) if (c->ssl || port == 443) { *b->last++ ='s'; } #endif and it works! But works hand in hand with this nginx configuration (in o

Re: listen proxy_protocol and rewrite redirect scheme

2016-09-17 Thread Francis Daly
On Sat, Sep 17, 2016 at 03:11:20AM -0400, adrhc wrote: Hi there, > Oh, and I only want this change to apply to servers with "listen ... > proxy_protocol" but not otherwise ... That makes the initial code-change suggestion (where *all* adjusted Location: headers would be https) insufficient. If

Re: listen proxy_protocol and rewrite redirect scheme

2016-09-17 Thread Francis Daly
On Sat, Sep 17, 2016 at 02:36:31AM -0400, adrhc wrote: Hi there, > yep, that's exactly my problem: > "... but that will not help internally-generated things like the > trailing-slash redirect for directories." > > I'll check your solution though I'm very open for other too :D If you care only a

Re: listen proxy_protocol and rewrite redirect scheme

2016-09-17 Thread adrhc
Oh, and I only want this change to apply to servers with "listen ... proxy_protocol" but not otherwise ... Posted at Nginx Forum: https://forum.nginx.org/read.php?2,269623,269640#msg-269640 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.or