how can I get each slash part of the url into a variable to write the proxy URL?
Example:
https://example.com/part1/part2 or https://example.com/sub/8080
Then
proxy_pass http://$part1.example.com:$part2;
how can I get each slash part of the url into a variable to write the proxy URL?
Example:
https://example.com/part1/part2 or https://example.com/sub/8080
Then
proxy_pass http://$part1.example.com:$part2;
With something like this:
location ~* /(.+)/(.+)$ {
set $hostpart $1;
set $urlpart $2;
proxy_pass http://$hostpart.example.com/$urlpart break;
}