September 17, 2016 09:25AM
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 order to keep original request's port: 443 for me):
port_in_redirect off;

and it's important for the initial request to come with 443 port. For me the flow is: request:443 go to sshttp:444 then stunnel:1443 and in the end to nginx (listen 127.0.0.1:1080 proxy_protocol).

This affects every server where the port is evaluated to 443 which is not perfect (in odd but possible situation 443 could be a non-ssl port or someone would want this for simply other ports too).

A perfect solution I think would be one where nginx would allow me to overwrite somehow the "c->ssl" above with a nginx-custom-variable, let's say $https_override (on = force c->ssl to evaluate to true; I guess "c->ssl" takes it's value from $https that's why $https_override ...).

------------------------
https://adrhc.go.ro
Subject Author Posted

listen proxy_protocol and rewrite redirect scheme

adrhc September 16, 2016 11:12AM

Re: listen proxy_protocol and rewrite redirect scheme

Francis Daly September 16, 2016 02:48PM

Re: listen proxy_protocol and rewrite redirect scheme

adrhc September 17, 2016 02:36AM

Re: listen proxy_protocol and rewrite redirect scheme

adrhc September 17, 2016 03:11AM

Re: listen proxy_protocol and rewrite redirect scheme

Francis Daly September 17, 2016 08:12AM

Re: listen proxy_protocol and rewrite redirect scheme

adrhc September 17, 2016 09:25AM

Re: listen proxy_protocol and rewrite redirect scheme

adrhc September 17, 2016 11:24AM

Re: listen proxy_protocol and rewrite redirect scheme

adrhc September 17, 2016 12:05PM

Re: listen proxy_protocol and rewrite redirect scheme

Francis Daly September 17, 2016 08:24AM

Re: listen proxy_protocol and rewrite redirect scheme

adrhc September 17, 2016 01:42PM

Re: listen proxy_protocol and rewrite redirect scheme

adrhc September 17, 2016 01:51PM

Re: listen proxy_protocol and rewrite redirect scheme

Francis Daly September 20, 2016 03:38PM

Re: listen proxy_protocol and rewrite redirect scheme

adrhc September 21, 2016 03:25AM

Re: listen proxy_protocol and rewrite redirect scheme

Francis Daly September 21, 2016 12:44PM

Re: listen proxy_protocol and rewrite redirect scheme

adrhc September 22, 2016 07:57AM

Re: listen proxy_protocol and rewrite redirect scheme

Francis Daly September 25, 2016 04:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 182
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready