Rewrite https to http expect one location

Francis Daly francis at
Mon Feb 24 18:07:38 UTC 2014

On Mon, Feb 24, 2014 at 04:10:24PM +0100, basti wrote:

Hi there,

>  # do not rewrite this
>  location /mailadmin/(.*.\.php)$ {

You probably will have no requests that will match this prefix location.

>  location / {
>       rewrite ^ http://$server_name$request_uri? permanent;

Many requests will match this location, and be redirected to a http url.

>  location ~ \.php$ {

Some requests will match this location.

> URLs like
> are partly rewrite.

I would expect that request to match the third location.

What response do you get for it? What response do you want for it?

Francis Daly        francis at

More information about the nginx mailing list