title: Nginx try root and then proxy backend
body: <p>I am trying to get nginx to first look in the root folder, and then if not found look in the (nodejs) proxy backend, but it's failing to look for static files not found in the root.</p>
  
  <p>I assume that the <strong>try_files $uri @backend;</strong> entry will first attempt to serve the files in root, and if that fails try in backend ??</p>
  
  <p>If I connect directly to port 3030 then it does serve the files, so the problem seems to be in the nginx config ?</p>
  
  <pre><code>server { 
  
    listen 80; 
    listen [::]:80; 
  
    listen 443 ssl http2; 
    listen [::]:443 http2; 
  
    server_name somesite.com; 
    root /usr/share/nodejs/public; 
  
    location / { 
      try_files $uri @backend; 
    } 
  
    location ~ .(?:ico|jpg|css|png|js|swf|woff|eot|svg|ttf|html|gif)$ { 
      add_header Pragma "public"; 
      add_header Cache-Control "public"; 
      expires 30d; 
    } 
  
    location @backend { 
      proxy_pass http://localhost:3030; 
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
      proxy_set_header Host $http_host; 
      proxy_set_header X-Forwarded-Proto $scheme; 
      proxy_buffering off; 
      proxy_cache_valid 502 5s;
    } 
  
    location = /444-response {return 444;} 
  }
  </code></pre>