Sorry,
this was a stupid question. Of course I need to redirect first to the SSL part and then check for the cookie or IP:
HTTP part:
location ^~ /api {
rewrite https://$http_host$request_uri; (rewrite the location to https)
}
HTTPS part:
location ^~ /api {
if ($iporcookiematches != 1) { (and then check if the ip or cookie matches)
return 403;
}
proxy_pass http://backend;
}
Please close this thread.
Cheers,
Szop
this was a stupid question. Of course I need to redirect first to the SSL part and then check for the cookie or IP:
HTTP part:
location ^~ /api {
rewrite https://$http_host$request_uri; (rewrite the location to https)
}
HTTPS part:
location ^~ /api {
if ($iporcookiematches != 1) { (and then check if the ip or cookie matches)
return 403;
}
proxy_pass http://backend;
}
Please close this thread.
Cheers,
Szop