在nginx php解析段增加以下
fastcgi_split_path_info ^(.+\.php)(.*)$;完整的配置如下
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
server {
listen 80;
server_name mydomain.vm www.mydomain.vm;
access_log /app/logs/nginx/mydomain_access.log;
error_log /app/logs/nginx/mydomain_error.log;
root /app/www/mydomain.vm/public;
location ~ / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php/$1 last;
break;
}
}
location ~ [^/]\.php(/|$) {
#try_files $uri = 404;
#fastcgi_pass remote_php_ip: 9000;
fastcgi_pass unix: /dev/shm/php-cgi.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
expires off;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires off;
access_log off;
}
location ~ /\.ht {
deny all;
}
}
网友回复
- 如何使用Grafana搭建一个监控仪表盘系统?
- 如何使用chatgpt直接调用midjourney或dall-2的api生成图片?
- 如何通过文字来识别用户需要绘画?
- 抖音字节小程序的虚拟商品订单如何使用php进行同步?
- 如何对html静态网站页面的html、css、js代码进行加密混淆?
- colorui radio标签为啥在小程序中会错位失效?
- mysql数据库被勒索病毒删除,如何通过mysqlbinlog恢复数据库?
- win10电脑的显存多少如何查看?
- 有没有类似chatgpt的开源中文对话聊天机器人模型?
- uniapp、小程序、h5的page页面onload方法如何在onLaunch执行完后再触发?