this post was submitted on 04 Jul 2024
1 points (100.0% liked)

nginx

4 readers
1 users here now

The nginx community on Reddit. Reddit gives you the best of the internet in one place.

founded 1 year ago
MODERATORS
 
The original post: /r/nginx by /u/CorgiClouds on 2024-07-03 20:19:44.

I have tried reading stack overflow and using chatgpt, but I keep losing the first part of my API end point when I try to switch things around with regex.

I want to redirect http://server/api/repo/t//channel to http://server/t//get/channel, but I keep just getting left with http://server/channel. Here is my most recent attempt:

location ~ ^/api/repo/t/(.*)$ {
    proxy_pass http://server/t/$1/get;
}

I have also tried using "rewrite", to no avail. Please let me know if anyone has any suggestions.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here