Currently i have
server {
listen 8080;
server_name default;
location /foo/ {
rewrite ^/foo(/.*)$ $1 break;
proxy_redirect https://example.com https://$host/;
}
This matches foo and essentially strips it. I need to maintain this functionality, and also include bar if it is after foo. i.e. if the url is /foo/bar
I want both of those essentially stripped. I'm not great at regex and am struggling with the proper way to do this.
I'm thinking something like (foo)|(\/bar)
, but not sure how to match a trailing slash with that as well.