title: Configuring Nginx proxy to pass through all requests except certain domains
body: <p>I have a simple Nginx proxy with the following config:</p>
  
  <pre><code>server {
        server_name www.myserver.com;
        location / {
          proxy_pass http://mytest.pagekite.me;
          proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
          proxy_redirect off;
          proxy_buffering off;
        }
      }
  </code></pre>
  
  <p>With this config all requests to <code>www.myserver.com</code> will be forwarded to <code>http://mytest.pagekite.me</code>. What I'd like to have is additional directive to pass through all other requests. Like, if the user requests <code>www.google.com</code> I'd like this proxy to forward this request.</p>
  
  <p>Tried quite a few things, like:</p>
  
  <pre><code>server {
       server_name ~^(www\.)?(.+)$;
       location / {
         proxy_pass $request_uri;
         proxy_redirect off;
         proxy_buffering off;
       }
     }
  </code></pre>
  
  <p>With this config I get server error 500 when requesting pages outside of www.myserver.com.</p>
  
  <p>What would be a correct config for the transparent proxying of all requests except for <code>www.myserver.com</code>?</p>