Showing posts with label ssl terimination. Show all posts
Showing posts with label ssl terimination. Show all posts

Monday, November 4, 2019

How to enable https backends in nginx without adding back-end server's certificates

lets assume that we have a requirement to proxy from https://nginxserverip:443 to https://backendserverip:443 as mentioned below,


below is a code sample,
server {
server_name nginxserverip;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host backendserverip;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
proxy_pass https://backendserverip/;
}
listen [::]:443 ssl;
listen 443 ssl;
ssl_certificate xxxxxxx.pem;
ssl_certificate_key xxxxxxxx.pem;
}
that’s it.