I
I
Ivan2022-03-18 16:23:02
Nginx
Ivan, 2022-03-18 16:23:02

Nginx how to fix adding slash at the end of url?

There is a site on Laravel. I want to add a slash at the end.

Made it this way

location / {
        rewrite ^([^.\?]*[^/])$ $1/ permanent;
        try_files $uri @clean_url;
}

On PC, android everything works fine. But on the iPhone, not in Safari.

When a person goes through Safari to a site, for example, via domen.com/ru, nginx automatically changes the link to domen.com/ru/, but as a result, my middleware in Laravel (which is needed) for some reason video this link as "/ru% 5C". Those. instead of a slash for some reason %5C. This is only on Safari.

How can I fix it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question