Hi,
I am trying to setup the following configuration.
I have two servers that sits behind an nginx load balancer.
So far this works well.
upstream load_balanced {
ip_hash;
server adress_of_server_A;
server adress_of_server_B;
}
server {
listen 80;
listen 8080;
location / {
proxy_pass http://load_balanced;
}
}
The proxy pass works.
However things get a little bit out of hand when I try to add the ssl support. The goal is to allow Nginx load balancer to be accessed via htttps, but then I want Nginx to access the load balanced server via regular http.
server {
listen 80;
listen 8080;
listen 443;
ssl on;
ssl_certificate dummy.crt;
ssl_certificate_key dummy.key;
location / {
proxy_pass http://load_balanced;
}
}
However this leads to host not reachable when accessing via https and when accessing via http it tells me:
<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>nginx/1.2.0</center>
</body>
</html>
Any ideas how I could achieve this?
Thank you