首页 > 系统相关 >页面404超时,nginx配置方案

页面404超时,nginx配置方案

时间:2024-10-24 17:20:33浏览次数:1  
标签:info 超时 param nginx 404 path php fastcgi

只需要更改子域名下的配置文件 vhosts.conf  文件,设置 php 读取超时时间即可

fastcgi_read_timeout 300;
location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9002;
            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;
            # 设置 PHP 读取超时时间
            fastcgi_read_timeout 300;
        }

 配置完之后,重启NGINX 服务即可

 

标签:info,超时,param,nginx,404,path,php,fastcgi
From: https://www.cnblogs.com/blts/p/18500018

相关文章

  • nginx 跨域配置
    userwwwwww;worker_processesauto;error_log/www/wwwlogs/nginx_error.logcrit;pid/www/server/nginx/logs/nginx.pid;worker_rlimit_nofile51200;stream{log_formattcp_format'$time_local|$remote_addr|$protocol|$status|$bytes_sent|$bytes_......
  • Keepalived+Nginx 高可用(主从模式)
     1.环境说明vipip操作系统nginx端口主从说明192.168.115.150192.168.115.148CentOSLinuxrelease7.6.1810(Core)8443主节点192.168.115.150192.168.115.149CentOSLinuxrelease7.6.1810(Core)8443从节点2台机器都需部署nginx和keealive服务,ngin......
  • nginx总结
    使用auth_basic控制访问nginx代理的网站,直接访问如果需要添加安全性,如需要输入用户名+密码才能访问页面,可以通过nginx的auth_baisc配置来实现检查htpasswd一般nginx的安装之后会自带或者nginx容器镜像自带root@ea6255db9f51:/config/nginx/site-confs#htpasswdUsage:......
  • Nginx的 MIME TYPE问题导致的mjs文件加载出错的问题解决
    .mjs文件:明确表示使用ES6模块系统(ECMAScriptModules)。 在服务器用Nginx部署前端项目后,出现下面这种问题Failedtoloadmodulescript:ExpectedaJavaScriptmodulescriptbuttheserverrespondedwithaMIMEtypeof"application/octet-stream".StrictMIMEt......
  • nginx 默认60超时需要修改的地址
    1、这个是转发的nginx的vhost模块的php,添加以下代码 ,如果没有,可以忽略location/{if($query_string~*"\.\./|\./"){return404;}proxy_read_timeout300s;#增加到5分钟proxy_connect_timeout300s;prox......
  • https免费nginx证书
    快捷阅读:先安装好nginx,并配置好80端口的正常访问#安装Nginxyuminstall-ynginx#设置开机启动systemctlenablenginx#开启nginxsystemctlstartnginx#重启nginxsystemctlrestartnginx#nginx重新加载配置文件systemctlreloadnginx#新增nginx网站配置......
  • centos7 nginx优化
    优化nginx进程个数的策略在高并发、高访问量的web服务场景,需要事先启动好更多的nginx进程,以保证快速响应并处理大量并发用户的请求。worker_processes1;一般调整到与CPU的颗数相同查看LInux可查看CPU个数及总核数grepprocessor/proc/cpuinfo|wc-l优化绑定不同......
  • Nginx配置基于IP地址的访问控制
    访问控制基于模块ngx_http_access_module实现,可以通过匹配客户端源IP地址进行限制在location中,通过allow、deny配置仅允许172.16.0.1的主机访问http://www.uhn.cn/admin其他地址均拒绝location=/admin{root/data/nginx/html/uhn;allow172.16.0.1/24;denyall;}locati......
  • Nginx配置auth_basic认证,让用户访问指定页面时输入用户名密码认证
    配置方法:[root@localhost~]#yum-yinstallhttpd-toolsLoadedplugins:fastestmirrorLoadingmirrorspeedsfromcachedhostfileResolvingDependencies-->Runningtransactioncheck--->Packagehttpd-tools.x86_640:2.4.6-99.el7.centos.1willbeinstall......
  • Nginx根据返回的错误码,自定义错误页面回显
    在/data/nginx/html/uhn目录下创建一个error.html[root@localhost~]#echo"errorpage">/data/nginx/html/uhn/error.html然后修改配置文件,将 500502503504404的错误页面指向/error.html页面[root@localhost~]#cdweb[[email protected]]#viuhn.confserver......