I’m trying to do something that I thought it was going to be very simple, but turned out is giving me lot of troubles.
I have a vhost under nginx defined like this
server {
listen 80;
server_name test.com;
root /var/apps/failover/;
location / {
index index.html index.htm;
}
}
What I want to do is that all the request that have a request_uri set (ex: test.com/something) will go to only test.com/.
I want a kind of wildcard for uri that will redirect the user to the root of the vhost.
I tried many combination of rewrite statements, but I didn’t have anything working.
I’m sure it’s supposed to be simple, but I can’t make it work.
I finally made it work with something like this:
Unsure if it’s the best way, but works fine and it does what I need