0

I have location

location ~ /(apple|club|car|fly|fitness|nivea|nesquik) {
    alias /srv/static-pages/$1.html;

}

I tried

location ~ /(apple|club|car|fly|fitness|nivea|nesquik)(\/)* {
    alias /srv/static-pages/$1.html;

}

But it nothing gives me Nginx gives me files accords uri, but i need work it with '/' at the end and without / Example: example.com/apple example.com/apple/ Now i don't know how i can configure it Help please

5
  • Which URL does not work? Aug 19, 2021 at 4:09
  • You can try location ~ ^/(apple|club|car|fly|fitness|nivea|nesquik)/?$ { ... } Aug 19, 2021 at 6:33
  • example.com/apple - works example.com/apple/ - doesnt work
    – user802047
    Aug 19, 2021 at 10:11
  • What does "doesn't work" mean exactly? What is the exact response? Aug 19, 2021 at 16:46
  • when i try example.com/apple - response is 200, its give me apple.html file. So when i try with slash example.com/apple / - response is 404. I need that nginx gives me same response when i try request like example.com/apple
    – user802047
    Aug 20, 2021 at 3:19

0

You must log in to answer this question.

Browse other questions tagged .