Score:1

Nginx proxy get each slash part into a variable

in flag

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;

Score:0
za flag

With something like this:

location ~* /(.+)/(.+)$ {
    set $hostpart $1;                                                                                            
    set $urlpart $2;                                                                                              

    proxy_pass http://$hostpart.example.com/$urlpart break;
}
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.