Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

redirect http to https, but exclude API

$
0
0
we switched a site from http to https, but for compatibility reasons we need some API to still be reachable by http.

our current redirect is:

server {
listen 80;
server_name www.mysite.com;

location ~ /.well-known {
root /var/www/html;
allow all;
}

return 301 https://$server_name$request_uri;
}

what do I need to change/add, to make sure POST requests to http://www.mysite.com/api/reportNew are not forwarded to https?
I tried some variants with location and root, but somehow never succeeded.

Viewing all articles
Browse latest Browse all 4759

Trending Articles