Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Loadbalance a website that only support https

$
0
0
Hello,

I want to load-balance a web page that only supports https. For me it is ok to terminate the incoming https connection and create a new one.
I tried with this config:

http {

upstream myapp1 {
server page1.myregion.cloudapp.azure.com:443;
server page2.myregion.cloudapp.azure.com:443;
}

server {
listen 443 default ssl;

ssl_certificate /etc/nginx/certs/portal-cert.pem;
ssl_certificate_key /etc/nginx/certs/portal-key.pem;

location / {
proxy_pass https://myapp1;
proxy_ssl_verify off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_ssl_certificate /etc/nginx/certs/portal-cert.pem;
proxy_ssl_certificate_key /etc/nginx/certs/portal-key.pem;
proxy_ssl_server_name on;
proxy_ssl_protocols SSLv2 SSLv3 TLSv1.1 TLSv1.2 TLSv1.3;
}
}
}

The log say still http:
[25/Jul/2017:14:14:59 +0000] 1XX.XXX.XXX.238 - - - to: 1XX.XXX.XXX.XXX:443: GET / HTTP/1.1 upstream_response_time 0.342 msec 1500992099.260 request_time 0.342 500 3003 "-

Also the upstream web page give me a error page with Status 500 say http is not allowed because https is expected.

What did I miss?

Thanks,
Daniel

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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