PHP菜鸟博客_共同学习分享PHP技术心得【PHP爱好者】
php的nginx站点,如何让所有的域名以及连接都显示一个升级页面
2025-9-25 菜鸟站长
1.站点根目录新建一个update的升级页面

    location / {

        # 直接返回 update.html,用 try_files 比 alias 更稳定

        try_files /update.html =404;

        # 禁止浏览器缓存(避免用户看不到最新维护页)

        expires 0;

        add_header Cache-Control "no-store, no-cache, must-revalidate";


    }



2.注释掉下面的php相关,否则访问php的路径不走上面的,由于优先级的问题。



   #include enable-php-56.conf;



   #include /www/server/panel/vhost/rewrite/platord2.php4.wlphp.com.conf;



3.看下具体的在配置文件中的位置



1.png2.png

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容