title: nginx proxy_pass to flask works while /static fail to find jquery
body: <p>I'm a noob an nginx (and apache and php ...)</p>
  
  <p>I've this flask app that works fine from:  </p>
  
  <p><code>http://127.0.0.1:5000</code><br>
  and also externally from<br>
  <code>http://myhost.com:5000</code>   </p>
  
  <p>I would like to use that from<br>
  <code>myhost.com/rest_1</code><br>
  to make room to others rest, like myhost.com/rest_2 .. 3 and so on.<br>
  The app resides in<br>
  <code>/opt/rest_1</code><br>
  and uses some resources from it's /static folder like css and jquery. </p>
  
  <p>I've this<br>
  <code>/etc/nginx/sites-available/rest_1.conf</code>  </p>
  
  <pre><code>server {
     listen 80;
     listen [::]:80;
     server_name myhost.com;
     server_name_in_redirect off;
  
     location /rest_1 {
              rewrite ^/rest_1(.*) /$1 break;
              proxy_pass http://127.0.0.1:5000/;
     }}
  </code></pre>
  
  <p>and it's link to sites-enabled.<br>
  nginx restart and reload with no errors.<br>
  Other configurations are default from installation.</p>
  
  <p>When i try to connect to     </p>
  
  <p><code>myhost.com/rest_1</code>  </p>
  
  <p>I can see an incomplete page partially working, looking at nginx log:<br>
  <code>/var/log/nginx/error.log</code>:  </p>
  
  <p><code>*8 open() "/usr/share/nginx/html/static/w3.css" failed (2: No such file or directory), client: xx.xx.xx.xx, server: myhost.com, request: "GET /static/w3.css HTTP/1.1", host: "myhost.com", referrer: "http://myhost.com/rest_1"</code>  </p>
  
  <p>So, it is clear to me that '/usr/share/nginx/html/' is got from elsewhere... and should also have a proper name that piece of folder (I'm a noob!!)   </p>
  
  <p>How to tell to the engine to redirect to the correct path on<br>
  <code>/opt/rest_1</code><br>
  to get back all /static functionalities ? </p>
  
  <p>OS: ubuntu server 16.04<br>
  nginx: 1.10.3</p>
  
  <p>Thanks.</p>