Hi Mark,

Personally I would be tempted to use the 'Redirect' directive in your pound
configuration file under the HTTP listener but keep the HTTPS listener as
it is.

So replace your HTTP Listener with something like this:

ListenHTTP
   Address 91.187.69.155
      Port    80

     Service
           HeadRequire "*.flooting.com <http://flooting.com>*"
           Redirect "https://flooting.com";
    End
End

Also you can simplify the HeadRequire directive to something like what I
have put above.

Let us know how this works for you.


~Scott


On 15 January 2013 09:58, mark hardwick <[email protected]> wrote:

> Hi All,
> I'm fairly new to both pound and apache configuration.  I think the issue
> I'm having is with pound configuration, but please excuse me if it's
> actually apache.
>
> Ok, I want to configure my site so that if people head to
> http://site.com/login they are redirected to https://site.com/login but,
> if they try to browse to https://site.com/somewhere_else then they are
> redirected to http://site.com/somewhere_else.
>
> I have installed my security certificate which is working.  I can browse
> http and https.
> I have configured pound to deal with the http and https as follows:
>
> ListenHTTP
>    Address 91.187.69.155
>       Port    80
>
>      Service
>            HeadRequire   "(Host: flooting.com|Host: www.flooting.com)"
>            BackEnd
>                Address 192.168.0.2
>                Port    80
>            End
>            BackEnd
>                Address 192.168.0.3
>                Port    80
>            End
>     End
> End
>
> ListenHTTPS
>   Address 91.187.69.155
>   Port    443
>   Cert    "/etc/ssl/flooting.com.pem"
>
>     Service
>         HeadRequire   "(Host: flooting.com|Host: www.flooting.com)"
>            BackEnd
>                Address 192.168.0.2
>                Port    80
>            End
>            BackEnd
>                Address 192.168.0.3
>                Port    80
>        End
>    End
> End
>
>
> I have configured apache ReWrite rules as follows:
>
>     RewriteEngine On
>     RewriteBase /
>
>     # force https for /login and /register etc
>     RewriteCond %{HTTPS} =off
>     RewriteRule ^(login|register)$ https://%{HTTP_HOST}%{REQUEST_URI}
> [R=301,L]
>
>     # don't do anything for images/css/js (leave protocol as is)
>     RewriteRule \.(gif|jpe?g|png|css|js)$ - [NC,L]
>
>     # force http for all other URLs
>     RewriteCond %{HTTPS} =on
>     RewriteCond %{REQUEST_URI} !^/(login|register|payment\/status|gopro)$
>     RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
>
>
> However the configuration does not work.
> It leads to a redirect loop error, which *appears* to be in pound.
> I say that because if I browse to flooting.com/login, pound attempts to
> send the request to /login about 10 times and then gives up.
> At this point the browser responds with a "this webpage has a redirect
> loop" error.  there are no errors in the apache logs.
>
> I've tried get this working with just one backend webserver configured in
> pound, however I still get a mail loop.
> So, what am I doing wrong?  Is this even remotely the correct approach to
> this problem or is there a better way?
>
> Thanks for your help
> Mark.
>
>
> --
> To unsubscribe send an email with subject unsubscribe to [email protected].
> Please contact [email protected] for questions.
>



-- 
With Kind Regards.

Scott McKeown
Loadbalancer.org
http://www.loadbalancer.org

Reply via email to