Similar to this, I am trying to host a squid proxy behind nginx:
example.com - the main site
example.com
relay.example.com - the squid server.
relay.example.com
I had this same problem, solved it by setting squid to run in transparent mode, like this:
http_port 3128 transparent