Forum: NGINX Load balancer and redirect to https

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D6a86ba3e8bcf85e7dc149c1b3094a63?d=identicon&s=25 Steve Zhuo (stevezhuo)
on 2009-05-09 03:29
HI

I would like to setup my Load Balancer to distribute the load to
different servers, and i would also like to forward all of the incoming
http request to the https port.   Here is my configuration:



upstream mysvr   {
  server server1:443
  server server2:443
}


 server {
        listen       80;
        server_name  www.server.com server.com;
  rewrite     ^/(.*)  https://$server_name/$1 permanent;

        }

server {
        listen       443;
        server_name  www.server.com server.com;

        ssl                  on;
        ssl_certificate      /etc/ssl/certs/myssl.crt;
        ssl_certificate_key  /etc/ssl/private/myssl.key;


       location / {
              proxy_pass  https://mysvr;

      }
    }


This doesn't work as expected, any help is appreciated.
This topic is locked and can not be replied to.