环境:Centos7.5+Nginx 1.16+PHP7.4+MYSQL5.6
问题一:URL无论怎么修改都无法不区分大小写;
问题二:使用location后php无法解析,打开变成下载;
求大神帮忙看一下,谢谢!
Nginx 网站规则如下:
server {
listen 80;
server_name 域名;
location ~ \/(upload|audio).*\.(mp3|jpeg|jpg|png|gif|csv)$ {
root /data/web/backend/public;
expires 7d;
}
location /dist {
root /data/web/adm;
index index.html;
location ~ .*\.(html|htm)$ {
expires 7d;
}
}
location / {
root /data/web/backend/www/adm;
index index.php index.html;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?_url=/$1 last;
}
client_max_body_size 3m;
location ~\.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
}
server {
listen 80;
server_name 域名;
location ~ \/upload.*\.(jpeg|jpg|png|gif)$ {
root /data/web/backend/public;
expires 1d;
}
location /dist {
root /data/web/h5;
index index.html;
location ~ .*\.(html|htm)$ {
expires 1s;
}
}
location / {
root /data/web/backend/www/web;
index index.php index.html;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?_url=/$1 last;
}
location ~\.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
}
|
|