Forum: NGINX Load balancer and redirect to https

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Steve Z. (Guest)
on 2009-05-09 05:29

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;
  rewrite     ^/(.*)  https://$server_name/$1 permanent;


server {
        listen       443;

        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.