数据库切换nginx部署流程

2018/5/20 posted in  OPS

部署流程

将维护页面上传到/var/www/maintain目录,并命名为index.html,设置权限为www-data:deploy用户

备份chupinxiu.com.conf配置文件

修改chupinxiu.com.conf的location /代码段为

    location / {
        index  index.php index.html index.htm;
        try_files /index.html =404;

        # kill cache
        add_header Last-Modified $date_gmt;
        add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
        if_modified_since off;
        expires off;
        etag off;
    }

备份/opt/openresty-1.13.6.1/lua/grayroot.lua

在web1上修改设置root的lua文件:/opt/openresty-1.13.6.1/lua/grayroot.lua

local real_path = "/var/www/maintain"
return real_path

重启nginx

恢复流程

删除/opt/openresty-1.13.6.1/lua/grayroot.lua文件并从备份文件恢复

删除chupinxiu.com.conf并从备份文件恢复

重启nginx