P
P
pentarh2012-08-17 15:34:54
Nginx
pentarh, 2012-08-17 15:34:54

Nginx as another proxy frontend

Hello.

It is required to put a proxy chain. Well, let's say, Internet -> Nginx -> Squid

Don't ask why =) The

trouble is that when I declare in nginx

location / {
  proxy_pass http://squid:3128;
  proxy_set_header Host $http_host;
}


Then Nginx addresses Squid not as a proxy server, but as a web server:

GET/HTTP/1.1
Host: mysqhostname.com


Accordingly, Squid responds with an HTTP 404 "WTF?!"

For Squid to understand Nginx, Nginx needs to make the following request:

GET http://mysqhostname.com/ HTTP/1.1
Host: mysqhostname.com

Question: how to configure Nginx so that it sends just such a request?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
snp, 2012-08-17
@snp

It's easier to configure squid so that "Host" understands:
http_port 3128 vhost

H
Hint, 2012-08-17
@Hint

Are you sure that the GET must contain the http protocol and the domain? Never encountered anything like it. The domain is specified in host (as required) and the protocol is specified in the GET string. I think it's something else.

V
VBart, 2012-08-18
@VBart

No way. It is not designed to work with a forward proxy. You need to switch squid to reverse mode if you want to befriend them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question