title: What I'm doing wrong in this proxy_pass Nginx + Tomcat 7
body: <p>I'm trying to redirect </p>
  
  <pre><code>http://example2:8080/folder2/app/index.html#/home
  </code></pre>
  
  <p>to</p>
  
  <pre><code>https://example2.com
  </code></pre>
  
  <p>using this code:</p>
  
  <pre><code>   location / {
              try_files $uri $uri/ =404;
              proxy_pass http://127.0.0.1:8080/folder2/;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header X-Forwarded-Proto $scheme;
              proxy_set_header X-Forwarded-Port $server_port;
     }
  </code></pre>
  
  <p>and I get HTTP Status 404 - from Tomcat</p>
  
  <p>There's another app on this Tomcat server which runs ok. This is the config:</p>
  
  <pre><code>location / {
              try_files $uri $uri/ =404;
              proxy_pass http://127.0.0.1:8080/folder1/;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header X-Forwarded-Proto $scheme;
              proxy_set_header X-Forwarded-Port $server_port;
  }
  </code></pre>
  
  <p>and is redirecting from:</p>
  
  <pre><code>http://example1:8080/folder1/
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>https://example1.com
  </code></pre>