Just add if condition to your Nginx configuration file as the below:
1 2 3 4 5 6 |
location ~ ^/$ { if ($http_cookie ~* "your_key=your_val") { return 302 https://example.com; } proxy_pass http://your_service; } |