Replacing apache with nginx

Gena Makhomed gmm at csdoc.com
Wed Oct 1 00:36:06 MSD 2008


On Tuesday, September 30, 2008 at 22:41:03, Stephen Nelson-Smith wrote:

SNS> redirects -everything- *apart from* http://www.example.com/xml,
SNS> which should be allowed to proceed as http only.

server {
    listen 443;
    server_name www.example.com;

    location = /xml {
        return 403;
    }
    
    location / {
        proxy_pass http://backend;
    }
}

server {
    listen 80;
    server_name www.example.com;
    
    location = /xml {
        proxy_pass http://backend;
    }
    
    location / {
        rewrite ^ https://www.example.com$request_uri permanent;
    }
}

-- 
Best regards,
 Gena






More information about the nginx mailing list