Answer the question
In order to leave comments, you need to log in
How to write a rule for nginx?
Good afternoon. Help with settings.
The site has a wi directory with all sorts of scripts.
Site migrated from apache to nginx.
The config contains rules for this folder:
location / {
#root /usr/share/nginx/html;
root /web/html/site.ru;
.....
autoindex off;
location = /wi {
rewrite ^(.*)$ /wi/;
}
location /wi\/ {
alias /wi/;
}
rewrite ^/([A-Za-z0-9\/\-\_]+)$ /index.php?path=$1;
rewrite ^/([A-Za-z0-9\/\-\_]+)\/$ /index.php?path=$1;
index index.php;
}
Answer the question
In order to leave comments, you need to log in
Read Proper Nginx Configuration especially section Passing Requests to PHP I
also recommend: How nginx handles requests
Configs to follow: https://github.com/elasticweb/nginx-configs
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question