Answer the question
In order to leave comments, you need to log in
How to rewrite url router in nginx?
Hello, there is nginx + php-fpm and the task is to redirect links to this route: http://example.com/page/...
Instead of the ellipsis, there will be full addresses of other sites. In this regard, the logic often breaks and nginx thinks that there are paths to local files. For example:
http://example.com/page/another.com/data/article.html
location ~ ^/page/ {
#rewrite ^/page/(.*)$ /index.php?$1;
set $url http://mysite.com.ua/index.php;
proxy_pass $url;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question