why $scheme in proxy_pass url does not work

Alexander Piavlo lists at ruby-forum.com
Mon Aug 4 02:03:31 MSD 2008


 Hi, I'm wondering why $scheme in proxy_pass url does not work?
 Using nginx 0.6.24

 The following does not work and results in BAD gateway error

 location ~ ^/~ {
    proxy_pass  $scheme://user-web.zopa.org;
    include /etc/nginx/proxy.conf;
    break;
  }
  include /etc/nginx/php.conf;
  rewrite ^/(.+)$ /index.php last;

 While the following works ok

  location ~ ^/~ {
    if ($scheme = http) {
        proxy_pass  http://user-web.zopa.org;
    }
    if ($scheme = https) {
        proxy_pass  https://user-web.zopa.org;
    }
    include /etc/nginx/proxy.conf;
    break;
  }
  include /etc/nginx/php.conf;
  rewrite ^/(.+)$ /index.php last;
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list