Welcome! Log In Create A New Profile

Advanced

rewrite + proxy_pass in named location?

Posted by btran 
rewrite + proxy_pass in named location?
March 27, 2018 04:30PM
Hi,

I have a named location where I'm trying to perform a proxy_pass, but of course I can't have a URI in the proxy_pass itself so I'm trying to use rewrite with proxy_pass. However, i've tried so many different things that don't seem to work.

Essentially, I want my proxy_pass URI to be "https://ph-service/authentication/token".

This is what I have so far and it's not working.

location @token {
rewrite ^ /$1/authentication/token break;
proxy_pass https://ph-service;
}

Thanks for the help!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 191
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready