nginx File not found 错误
使用php-fpm解析PHP,"No input file specified","File not found"是常见错误,原因是php-fpm进程找不到SCRIPT_FILENAME配置的要执行的.php文件,php-fpm返回给nginx的默认404错误提示。
出现这类错误,十个有九个是后端fastcgi进程收到错误路径(SCRIPT_FILENAME),而后端fastcgi收到错误路径的原因大都是配置错误。
可以参考我的nginx.conf的配置:
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name qanme.thenoob.top; #charset koi8-r; #access_log logs/host.access.log main; #这里配置存放网站代码的路径 location / { root /var/www/web; index index.html index.htm index.php; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #输入网址是下载文件多半是下面一行的错误 fastcgi_param SCRIPT_FILENAME /var/www/web$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} }

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
结合Zabbix与Ansible打造自动化数据库监控体系
一、前言 随着业务的飞速发展,数据库服务器量级飞速增长,比如Oracle、MySQL、Redis、MongoDB的使用更加普及,对数据库运维人员的要求也越来越高,构建一个真正好用的监控系统是一项艰巨的任务。在监控系统的开源软件中,可供选择的工具众多,然而真正适合自己需求、能够真正解决自己数据库问题的监控系统软件却凤毛麟角。 Zabbix和Ansible分别是两款非常流行的开源监控和自动化工具。具有上手简单,学习曲线平滑、配置简单、功能强大、扩展性强等优点。 本次将分享如何使用Zabbix并结合Ansible打造自动化数据库监控体系。 二、Zabbix自动化核心功能介绍 Zabbix是企业级监控解决方案,和自动化相关的核心功能包括:LLD、API、Zabbix_trapper。 1、LLD 在数据库监控中监控的对象往往是变化的,以部署Redis来说:近几年硬件发展迅速,在企业中新购的X86服务器配置基本都在32C、256GB以上,大家都知道Redis是用“单线程-多路复用IO模型”来实现高性能的内存数据服务,只能用到一个CPU核心,内存配置一般也在8G-16G左右,为了提高资源利用率,一...
- 下一篇
java 面试题分析
题: 定义两个 Integer 对象传递给一个方法, 方法执行后两个 Integer 的值需要互相转换 public static void practise(MyConsumer<Integer> consumer) { Integer value1 = 1; Integer value2 = 2; System.out.println("start: value1=" + value1 + ", value2=" + value2); consumer.accept(value1, value2); System.out.println("end: value1=" + value1 + ", value2=" + value2); } @FunctionalInterface public interface MyConsumer<T> { void accept (T value1, T value2); } 编程方式一: 传值与传引用的区别 practise((value1, value2) -> { Integer temp = value1;...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- Windows10,CentOS7,CentOS8安装MongoDB4.0.16
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
- CentOS关闭SELinux安全模块
- CentOS8,CentOS7,CentOS6编译安装Redis5.0.7
- SpringBoot2整合Redis,开启缓存,提高访问速度
- CentOS7安装Docker,走上虚拟化容器引擎之路
- Docker使用Oracle官方镜像安装(12C,18C,19C)
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- Eclipse初始化配置,告别卡顿、闪退、编译时间过长
- Windows10,CentOS7,CentOS8安装Nodejs环境