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

proxy pass to https

$
0
0
I need to proxy requests from nginx to a microservice that has SSL set up.
When I use https I see an error that says: nginx: [emerg] host not found in upstream "service_hosts" in /etc/nginx/conf.d/server.conf:368

When I use http, I don't get the error.

The Nginx server also has SSL turned on and is listening on 443.

Here is a snippet of my configuration:
location /api/service/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;

proxy_pass https://service_hosts/api/service/;
proxy_redirect off;

# Handle Web Socket connections
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

# this is the magic
error_page 405 =200 $uri;

#health_check;
}

Why does it not like https?

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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