Passenger 5 work together with Squid.

176 views
Skip to first unread message

郑伟

unread,
Jan 3, 2016, 7:16:12 AM1/3/16
to Phusion Passenger Discussions
I like squid, I use it as forward proxy + reverse proxy.

any advice about those two amazing things worked together ?

Thanks

Daniel Knoppel

unread,
Jan 4, 2016, 10:32:28 AM1/4/16
to Phusion Passenger Discussions
Do you have a more specific question? They should work together.

- Daniel

郑伟

unread,
Jan 4, 2016, 4:33:03 PM1/4/16
to Phusion Passenger Discussions
Thanks, actually, it not worked for me, detailed description is:

1. squid as reverse proxy(80), forward request to passenger standalone (3000)
2.  I can access passenger webserver directly with MY_HOST_IP:3000
3.  squid forward to passenger is not worked, passgener response: 503 Service Unavailable  (detailed squid debug log below)
4.  if start with `rails s`, squid forward is work for me.

Error message in squid page:

The following error was encountered while trying to retrieve the

Connection to ::1 failed.

The system returned: (111) Connection refused

The remote host or network may be down. Please try the request again.



Squid log;


  ==> /var/log/squid/cache.log <==
---------
GET / HTTP/1.1
Host: MY_HOST_IP
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: _payment_session=N3dlNkRKS1dKejd3WGVSd2QveEcrTzZaMENuN3JUc3pNL1BrZ2VQalprZ3htZGtrRG5BeWY4WTdmanpzRXZCeWZnNjNQd2F0Wm9ZdVd5VzFIZ3JPZkxRZ3pUMTN1U0JNTjUwWUpDVU4xNUgrZ0tCZWdFT3BGRFlLZlFadGNBQ1NFbndHQmk2WFQyNnNLOEh0YVBrWkRoSHh3QnlYL2tNZ1NwT3VXKzdNUjJkcHJJRThKTEd3TVdYajU2Mm5zazdSRWcwenhRNGNpMzY1dTAxb0VQWUJyL3I0dFZLanFhRTRyRXVsK21lMUdXSENabnVSbXFTV3poUHJNd2JscmJ3RGZTeit6YW9vSVpEaHByOGx0UlJXc09Ib1M3dGRGdWFsNlB6UWJkcmN5cGc9LS0yZ1RMMk4vUnByTVNQSVBaODZINnVBPT0%3D--c4eb424b0c331b8469d10c85d579f7d5359bc756
Connection: keep-alive


----------
2016/01/04 21:15:00.225 kid1| 11,2| client_side.cc(1391) sendStartOfMessage: HTTP Client local=MY_HOST_IP:80 remote=MY_LOCAL_IP:4695 FD 14 flags=1
2016/01/04 21:15:00.225 kid1| 11,2| client_side.cc(1392) sendStartOfMessage: HTTP Client REPLY:
---------
HTTP/1.1 503 Service Unavailable
Server: squid/3.5.12
Mime-Version: 1.0
Date: Mon, 04 Jan 2016 21:15:00 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 4265
X-Squid-Error: ERR_CONNECT_FAIL 111
Vary: Accept-Language
Content-Language: en-us
X-Cache: MISS from squid.proxy
Via: 1.1 squid.proxy (squid/3.5.12)
Connection: keep-alive


----------

==> /var/log/squid/access.log <==
1451942100.226      1 MY_LOCAL_IP TCP_MISS/503 4618 GET http://MY_HOST_IP/ - ANY_OLD_PARENT/::1 text/html
MY_LOCAL_IP - - [04/Jan/2016:21:15:00 +0000] "GET http://MY_HOST_IP/ HTTP/1.1" 503 4618 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0" TCP_MISS:ANY_OLD_PARENT


在 2016年1月3日星期日 UTC+8下午8:16:12,郑伟写道:

郑伟

unread,
Jan 5, 2016, 3:09:28 AM1/5/16
to phusion-...@googlegroups.com
I have tried passenger-ruby-rails-demo, same case is happen.

1. rails s worked with squid. (squid forward to rails s port 3000)
2.  passenger start is not worked.
3. passenger start worked if visit from port 3000 directly.

Hongli Lai

unread,
Jan 5, 2016, 5:27:51 AM1/5/16
to phusion-passenger
You configured Squid to forward to an IPv6 address. Passenger isn't
listening on IPv6, it's listening on IPv4. So you need to configure
Squid to forward to '127.0.0.1', not 'localhost' (which primarily maps
to the IPv6 address '::1').
> --
> You received this message because you are subscribed to the Google Groups
> "Phusion Passenger Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phusion-passen...@googlegroups.com.
> To post to this group, send email to phusion-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/phusion-passenger.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phusion-passenger/c10d3e0f-0bc0-4cf1-a610-d7c7ec5f81f8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Phusion B.V. | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 63501007 (The Netherlands)

zw963

unread,
Jan 12, 2016, 4:38:36 PM1/12/16
to phusion-...@googlegroups.com
Hongli Lai writes:

> You configured Squid to forward to an IPv6 address. Passenger isn't
> listening on IPv6, it's listening on IPv4. So you need to configure
> Squid to forward to '127.0.0.1', not 'localhost' (which primarily maps
> to the IPv6 address '::1').

Sorry for late reply, I seem like missing something in my email.

Thank you very much, It worked!



--
You received this message because you are subscribed to a topic in the Google Groups "Phusion Passenger Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phusion-passenger/mttMT2-5nUk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phusion-passen...@googlegroups.com.

To post to this group, send email to phusion-...@googlegroups.com.
Visit this group at https://groups.google.com/group/phusion-passenger.
Reply all
Reply to author
Forward
0 new messages