I\'m trying to redirect requests to https in nginx, unless it is of the form HOST/ANY_STRING_OF_CHARS/END_OF_URI, e.g.:
http://host.org/about # no redirect<
Sends a permanent redirect to the client:
server { listen 80; rewrite ^(/users/\w+)$ https://$host$1 permanent; ... }
for negative match you could use:
if ($request_uri !~ "^/users/\w+$") { return 301 https://$host$request_uri; }