0

i am trying to get nginx to pass

"your-domain.com/test" 

to

http://localhost:{9001}

i am new to nginx and had success with the following:

server {
    listen 80;

    server_name your-domain.com;

    location / {
        proxy_pass http://localhost:{9001};
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
    }
}

Now i am able to pass my domain to the port 9001. Now i want to adapt this in that way, that i am able to pass your-domain.com/test to localhost:{9001}. Is this possible? what do i have to change?

i tried

location /test
server_name your-domain.com/test

both without success.

divramod
  • 41
  • 1

1 Answers1

1
location ~ /test

In fact, location need an operator (=, ~ ...) to match an uri. "location /" mean 'everything'.

Hakaba
  • 11
  • 1