title: How to forward all paths that start with a specific location in nginx?
body: <p>I want to forward all paths that start with /api/ (/api/*  ??) to port 1000 but the actual configuration either forwards only the paths that contain "/api/" and nothing else after (/api/login is not forwarded) </p>
  
  <pre><code>location /api/ {
                      proxy_pass http://localhost:1000/;
              }
  </code></pre>
  
  <p>or it doesn't work at all</p>
  
  <pre><code>location ~ ^/api/(.*)$ {
                      proxy_pass http://localhost:1000/;
              }
  </code></pre>
  
  <p>. The server is cinfigured as fallows:</p>
  
  <pre><code>server {
              listen       80;
              keepalive_timeout    70;
              server_name  server_name;
  
              location / {
                      root /var/www/html;
                      index index.html;
              }
              location /api/ {
                      proxy_pass http://localhost:1000/;
              }
              }
  </code></pre>
  
  <p>I would appreciate any help, Thank you!</p>