用户替换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

 

相关文章:

  • 2021-08-28
  • 2021-07-31
  • 2021-12-16
  • 2021-04-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
相关资源
相似解决方案