frontend links include backend port

Jan Weiher jan-varnish at buksy.de
Tue Nov 2 23:16:32 CET 2010


Hi,

is it possible that your webapplication is adding the portnumber to the
links? I've been using varnish in a similar configuration for a while
now and did not see such a behaviour.

best regards,
Jan



Am 02.11.2010 22:23, schrieb Mark C. Stafford:
> I've used squid as an accelerator in the past and would like to try
> varnish. I don't understand why links to my site show up as
> http://site:8100/query-etc right now.
> 
> How can I get the backend port out of my links? Should I expect to
> have to rewrite them?
> 
> I'm using current packages for apache and varnish.
> 
> Thanks
> 
> Mark
> 
> 
> 
> # from /etc/init.d/varnish
> # DAEMON_OPTS="-a 0.0.0.0:80 -T 0.0.0.0:8200 -f
> /etc/varnish/varnish.vcl -S /etc/varnish/secret -s
> file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G"
> DAEMON_OPTS="-T :8200 -f /etc/varnish/varnish.vcl -S
> /etc/varnish/secret -s
> file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G"
> 
> # from ports.conf
> NameVirtualHost *:8100
> Listen 127.0.0.1:8100
> 
> # from varnish.vcl
> backend default {
>   .host = "127.0.0.1";
>   .port = "8100";
> }
> 
> # other info
> 
> kernel
>   2.6.18.8-xen
> distro
>   debian/lenny
> apache
>   2.2.9-10+lenny8
> varnish
>   2.1.4-1~lenny1
> 
> # netstat -anp | grep varnish
> tcp        0      0 0.0.0.0:8200            0.0.0.0:*
> LISTEN      19911/varnishd
> tcp        0      0 0.0.0.0:80              0.0.0.0:*
> LISTEN      19912/varnishd
> tcp        1      0 127.0.0.1:49060         127.0.0.1:8100
> CLOSE_WAIT  19912/varnishd
> tcp6       0      0 :::8200                 :::*
> LISTEN      19911/varnishd
> unix  2      [ ]         DGRAM                    687365   19911/varnishd
> 
> # netstat -anp | grep apache
> tcp        0      0 127.0.0.1:8100          0.0.0.0:*
> LISTEN      19987/apache2
> 
> # varnishlog -o
> 
> 13 TxRequest    - GET
> 13 TxURL        - /
> 13 TxProtocol   - HTTP/1.1
> 13 TxHeader     - Host: *****
> 13 TxHeader     - Accept:
> application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> 13 TxHeader     - User-Agent: Mozilla/5.0 (X11; U; Linux x86_64;
> en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41
> Safari/534.7
> 13 TxHeader     - Accept-Encoding: gzip,deflate,sdch
> 13 TxHeader     - Accept-Language: en-US,en;q=0.8
> 13 TxHeader     - Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
> 13 TxHeader     - Cookie: PHPSESSID=4b594099f859844319e122a3291c2d37
> 13 TxHeader     - X-Forwarded-For: ***.***.***.***
> 13 Length       - 3373
> 13 BackendReuse - default
> 12 SessionOpen  c ***.***.***.*** 32211 0.0.0.0:80
> 12 ReqStart     c ***.***.***.*** 32211 1997066746
> 12 RxRequest    c GET
> 12 RxURL        c /
> 12 RxProtocol   c HTTP/1.1
> 12 RxHeader     c Host: *****
> 12 RxHeader     c Connection: keep-alive
> 12 RxHeader     c Cache-Control: max-age=0
> 12 RxHeader     c Accept:
> application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> 12 RxHeader     c User-Agent: Mozilla/5.0 (X11; U; Linux x86_64;
> en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41
> Safari/534.7
> 12 RxHeader     c Accept-Encoding: gzip,deflate,sdch
> 12 RxHeader     c Accept-Language: en-US,en;q=0.8
> 12 RxHeader     c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
> 12 RxHeader     c Cookie: PHPSESSID=4b594099f859844319e122a3291c2d37
> 12 VCL_call     c recv pass
> 12 VCL_call     c hash hash
> 12 VCL_call     c pass pass
> 12 Backend      c 13 default default
> 12 TTL          c 1997066746 RFC 0 1288731432 1288731432 375007920 0 0
> 12 VCL_call     c fetch pass
> 12 ObjProtocol  c HTTP/1.1
> 12 ObjStatus    c 200
> 12 ObjResponse  c OK
> 12 ObjHeader    c Date: Tue, 02 Nov 2010 20:57:12 GMT
> 12 ObjHeader    c Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9
> with Suhosin-Patch
> 12 ObjHeader    c X-Powered-By: PHP/5.2.6-1+lenny9
> 12 ObjHeader    c Expires: Thu, 19 Nov 1981 08:52:00 GMT
> 12 ObjHeader    c Pragma: no-cache
> 12 ObjHeader    c X-action: display_home
> 12 ObjHeader    c Vary: Accept-Encoding
> 12 ObjHeader    c Content-Encoding: gzip
> 12 ObjHeader    c Content-Length: 3373
> 12 ObjHeader    c Content-Type: text/html;charset=utf-8
> 12 VCL_call     c deliver deliver
> 12 TxProtocol   c HTTP/1.1
> 12 TxStatus     c 200
> 12 TxResponse   c OK
> 12 TxHeader     c Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9
> with Suhosin-Patch
> 12 TxHeader     c X-Powered-By: PHP/5.2.6-1+lenny9
> 12 TxHeader     c Expires: Thu, 19 Nov 1981 08:52:00 GMT
> 12 TxHeader     c Pragma: no-cache
> 12 TxHeader     c X-action: display_home
> 12 TxHeader     c Vary: Accept-Encoding
> 12 TxHeader     c Content-Encoding: gzip
> 12 TxHeader     c Content-Length: 3373
> 12 TxHeader     c Content-Type: text/html;charset=utf-8
> 12 TxHeader     c Content-Length: 3373
> 12 TxHeader     c Date: Tue, 02 Nov 2010 20:57:12 GMT
> 12 TxHeader     c X-Varnish: 1997066746
> 12 TxHeader     c Age: 0
> 12 TxHeader     c Via: 1.1 varnish
> 12 TxHeader     c Connection: keep-alive
> 12 Length       c 3373
> 12 ReqEnd       c 1997066746 1288731432.496306896 1288731432.680691957
> 0.000109911 0.184325218 0.000059843
> 
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://lists.varnish-cache.org/mailman/listinfo/varnish-misc




More information about the varnish-misc mailing list