title: Can squid run behind nginx?
body: <p>I'm trying to run a squid server behind nginx.
  I configured nginx like this:</p>
  
  <pre><code>server {
      listen     8080;
      location / {
          proxy_pass   http://localhost:3128;
          proxy_set_header Host  $host;
          proxy_set_header X-Real-IP   $remote_addr;
      }
  }
  </code></pre>
  
  <p>Then I set my http network proxy to:</p>
  
  <pre><code>my-nginx-server-address:8080
  </code></pre>
  
  <p>So when I try to view the Google homepage, the nginx will get the request:</p>
  
  <pre><code>Get http://www.google.com/ HTTP/1.1
  </code></pre>
  
  <p>However when nginx pass the request to squid it will change the request_uri to </p>
  
  <pre><code>/
  </code></pre>
  
  <p>So squid won't work.
  Is there any way I can set the request_uri back to <a href="http://www.google.com" rel="noreferrer">http://www.google.com</a> then pass it to squid? Or any other ways I can run squid behind nginx? </p>