Eric,

I'm doing something similar, but I have the Service directive outside of
the ListenHTTP(S) directives, with the redirects at the top before the
BackEnds. I'm listening on all IPs (the servers only have one) which might
make a difference. Here's a snippet of one of my configs that might be
useful to you:

ListenHTTP
    Address 0.0.0.0
    Port 80
    AddHeader "X_FORWARDED_PROTO: http"
End

ListenHTTPS
    Address 0.0.0.0
    Port    443
    Cert    "/usr/local/etc/server.pem"
    AddHeader "X_FORWARDED_PROTO: https"
    Ciphers "HIGH:MEDIUM:!SSLv2:!ADH:!aNULL:!eNULL:!NULL"
End

Service
    HeadRequire "^Host: .*old.foo.com.*$"
    Redirect 301 "http://new.foo.com";
End

Service
    HeadRequire "^Host: .*old.foo.com.*$"
    Redirect 301 "http://new.foo.com";
End

Service
    BackEnd
        Address 10.0.0.1
        Port    443
        HTTPS
    End
End

-Brian

On Fri, Sep 12, 2014 at 9:21 AM, ericr <[email protected]> wrote:

> Hi,
>
> My company decided to rename our web app, and use a new domain name for
> it.  So I'm trying to get pound to redirect from the old URL to the new
> URL, and update the clients address bar so they can see they're on the new
> site.  I'm using pound 2.6 from the FreeBSD ports tree.
>
> Here's my pound.cfg:
>
> ListenHTTP
>     Address 192.78.80.153
>     Port 80
>     Service
>         HeadRequire "Host: .*test.foo.com.*"
>            Backend
>                Address 10.1.1.11
>                Port 8080
>            End
>            Session
>               Type COOKIE
>               ID   "phpsessid"
>               TTL 300
>            End
>     End
> End
>
> ListenHTTPS
>     Address 192.78.80.153
>     Port 443
>     Cert "/usr/local/etc/2014-geotrust-test_foo_com.crt"
>     Service
>         HeadRequire "Host: .*test.foo.com.*"
>            Backend
>                Address 10.1.1.11
>                Port 8080
>            End
>            Session
>               Type COOKIE
>               ID   "phpsessid"
>               TTL 300
>            End
>     End
> End
>
> ListenHTTP
>     Address 192.78.80.156
>     Port 80
>         Service
>             HeadRequire "Host: .*www.bar.com.*"
>             Redirect 301 "http://test.foo.com";
>         End
> End
>
>
> ListenHTTPS
>         Address 192.78.80.156
>         Port 443
>         Cert "/usr/local/etc/server.pem"
>         Service
>             HeadRequire "Host: .*www.bar.com.*"
>             Redirect 301 "http://test.foo.com";
>         End
> End
>
> Right now, when I use this configuration, I get this in the pound log:
>
>
> Sep 10 11:30:46 <daemon.notice> test-gate1 pound: (801c08800) e503 no
> service "GET / HTTP/1.1" from 10.1.1.153 test.docbasedirect.com
> Sep 10 11:30:46 <daemon.notice> test-gate1 pound: (801c08c00) e503 no
> service "GET /favicon.ico HTTP/1.1" from 10.1.1.153 test.docbasedirect.com
> Sep 10 11:31:04 <daemon.notice> test-gate1 pound: (801c09800) e503 no
> service "GET / HTTP/1.1" from 10.1.1.153 www.lionbait.com
> Sep 10 11:31:05 <daemon.notice> test-gate1 pound: (801c09c00) e503 no
> service "GET /favicon.ico HTTP/1.1" from 10.1.1.153 www.lionbait.com
>
> and of course, the client shows that there's no service available,
> regardless of which URL I point it at.
>
> So my question is, what do I need to do to get pound to redirect to the
> right URL and update the clients address bar?
>
> Thanks much!
>
> -- ericr
> [email protected]
>
>
>

Reply via email to