使用nginx后伪静态出问题,不支持伪静态的路径访问了。例如:http://127.0.0.1/cms/ 不支持这样访问了
使用nginx后伪静态出问题,要配置
server { listen 9001;
server_name www.ff.com *.ff.com;
root "D:\2.work\fastadmin\1.2.0.20201008_full\public";
client_max_body_size 300m;
client_header_timeout 5m;
client_body_timeout 5m;
proxy_connect_timeout 6000s;
proxy_read_timeout 5m;
proxy_send_timeout 5m;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
location / {
index index.html index.htm index.php;
#主要是这一段一定要确保存在
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
#结束
#autoindex on;
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
关键是这段
location / {
index index.html index.htm index.php;
#主要是这一段一定要确保存在
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
#结束
#autoindex on;
}