0

I have a webservice using the following routes in nginx:

/my/myservice/backend
/my/myservice/frontend

In addtion, I want the two urls

/my/myservice
/my/myname

to be aliases or redirects to /my/myservice/frontend ow can I configure nginx to achieve this?

mat
  • 548
  • 6
  • 20
  • What have you tried? What did you expect to happen? What happened instead? What does your config look like? Do you have any log entries from the times it didn't work as expected? – Jenny D Jun 22 '17 at 11:46

1 Answers1

1

Inside your server block you want something like this:

location /my/myservice { 
    return 301 $scheme://$http_host/my/service/frontend;
}

location /my/myname { 
    return 301 $scheme://$http_host/my/service/frontend;
}
Joe Brailsford
  • 1,181
  • 8
  • 10