listen proxy_protocol and rewrite redirect scheme

adrhc nginx-forum at forum.nginx.org
Sat Sep 17 19:41:34 UTC 2016


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

In order to work nginx needs this config: 
	server {
		listen 127.0.0.1:443		proxy_protocol;
		port_in_redirect		on;

stunnel.conf: 
[tls to http] 
sni = tls:* 
connect = 127.0.0.1:443 
protocol = proxy

fastcgi_params:
#
http://tyy.host-ed.me/pluxml/article4/port-443-for-https-ssh-and-ssh-over-ssl-and-more
fastcgi_param HTTPS "on";
fastcgi_param SERVER_PORT "443";

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,269623,269646#msg-269646



More information about the nginx mailing list