Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

listen proxy_protocol and rewrite redirect scheme (3 replies)

$
0
0
Hi, I have this setup:

the browser request (https on 443) is received by sshttp which sends it to stunnel:1443 which proxy it to nginx:1080.
When nginx receives the request it has $scheme = "http"; so, for any rewrite with "permanent" or "redirect" the Location header uses "http" while I really need "https" scheme.

Is there any way for forcing nginx to change $scheme according to my will?
or at least to generate the Location header with no scheme or with my desired scheme?

Thank you

nginx configuration:
server {
listen 127.0.0.1:1080 proxy_protocol;
port_in_redirect off;
server_name_in_redirect off;
...
}

stunnel configuration:
[tls]
accept = ************:1443
connect = 127.0.0.1:1080
protocol = proxy
[ssh]
sni = tls:tti.go.ro
...
[www on any]
sni = tls:*
connect = 127.0.0.1:1080
protocol = proxy

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>