title: Nginx redirect config issue
body: <p>I have nginx  bitnami container deployed in Openshift that serves my application. The issue that I am facing is that the redirect is not working. In the logs, there are no indications that the request is caught by a <code>proxy_pass</code> location block.</p>
  
  <p>So. the idea is that a request to <code>app.com/backend1/api/something</code> should be forwarded to <code>service1.com/backend1/api/something</code>. The same goes for service2.</p>
  
  <pre><code>worker_processes 1;
  
  events {
    worker_connections 1024;
  }
  
  http {
  
      upstream service1 {
        server service1.com;
      }
  
      upstream service2 {
        server service2.com;
      }
  
      server {
        listen 8443 ssl;
        listen [::]:8443 http2 ssl;
  
        server_name app.com;
  
        error_log  /opt/bitnami/nginx/error.log  debug;
  
  
        ssl on;
        ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
        ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
        ssl_dhparam /etc/ssl/certs/dhparam.pem;
  
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
        ssl_session_cache   shared:SSL:10m;
        ssl_session_timeout 10m;
        keepalive_timeout   70;
  
        include /opt/bitnami/nginx/conf/mime.types;
  
        root /opt/bitnami/nginx/html;
  
        location ~ ^/backend1/api/(.*)$ {
          proxy_pass https://service1/backend1/api/$1;
          proxy_http_version 1.1;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto $scheme;
        }
  
        location ~ ^/backend2/api/(.*)$ {
          proxy_pass https://service2/backend2/api/$1;
          proxy_http_version 1.1;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto $scheme;
        }
  
        location / {
          try_files $uri /index.html;
        }
  
      }
  }
  </code></pre>
  
  <p>I have also tried moving the order of the <code>location</code> blocks, as well as moving the <code>root</code> directive, but without success. </p>
  
  <p>Any ideas on how to resolve this issue?</p>