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

Re: Rewrite location and then proxy_pass

$
0
0
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

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>