I've setup pound on my Debian Squeeze server (pound package from the repository
2.5-1) with the following config:
## Minimal sample pound.cfg see pound(8) for details
global
options:
User"www-data"Group "www-data"#RootJail "/chroot/pound"
## Logging: (goes to syslog by default)## 0 no logging##1
normal##2 extended## 3 Apache-style (common log
format)LogLevel0
## check backend every X secs:Alive 30
## use hardware-accelleration card supported by openssl(1):#SSLEngine ""
# poundctl control socketControl "/var/run/pound/poundctl.socket"
listen, redirect and ... to:
## redirect all requests on port 8080 ("ListenHTTP") to the local webserver
(see "Service" below):ListenHTTPAddress 111.111.111.111 # My external IP
Port80
## allow PUT and DELETE also (by default only GET, POST and HEAD)?:
xHTTP 0
Service BackEnd Address 127.0.0.1
Port80 End EndEnd
Apache is running on localhost port 80.When I visit my site via mysite.com all
goes well. However when visiting my site via www.mysite.com the browser replies
with too many redirects.
The website on Apache has a .htaccess file which does the redirect from
www.mysite.com to mysite.com
RewriteCond %{HTTPS} !=onRewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]RewriteRule ^
http://%1%{REQUEST_URI} [R=301,L]
If I setup nginx as a reverse proxy I don't get too many redirects when
requesting www, but I don't want nginx I like Pound more.What could cause the
problem of the loop?
I made a fix with this:
Service HeadRequire "^Host: www.mysite.com$"Redirect 301
"http://mysite.com"End
But I would like to know why the loop occurs and if there is a other solution.