0

How do I prevent a location from being matched by the ssl rewrite?

server {
        listen      80;
        server_name example.net;

        location = /feeds/ {
                break;
        }

        rewrite     ^   https://$server_name$request_uri? permanent;
}
server {
        listen 443;
        ...

1 Answer 1

1

Put the rewrite in a location block. nginx only applies one location block at each level, so if /feeds/ is matched the other block won't be applied:

location / {
    rewrite     ^   https://$server_name$request_uri? permanent;
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .