用戶替換html中的字符
location / { root /opt/app/code/; random_index on; index index.html index.htm; sub_filter '<h1>Admin' '<h1>ggggg'; //第一個參數是要被替換的,第二個參數是替換后的 sub_filter_once off; //替換所有的,默認是on,替換第一個 }
改完保存下,使用命令檢查nginx語法是否正確
nginx -tc /etc/nginx/nginx.conf
平滑重啟nginx
nginx -s reload -c /etc/nginx/nginx.conf
