梦丶随心飞 2022-01-04 13:50 采纳率: 0%
浏览 215

当nginx通过sub_filter替换内容是vue模板参数时,替换无效怎么解决?

如题,在配置nginx的时候使用sub_filter替换网页展示的内容,当页面为静态页面的时候,替换没有问题,但是当页面为vue渲染的页面,且替换的内容为vue模板字段的时候,内容无法被替换。
      <form id="toPHPMyAdmin" public-data="{{session['domain']}}/index" action="{{session['domain']}}/index" method="post" style="display: none;" target="_blank">
        <input type="text" name="pma_username" id="pma_username" value="" />
        <input type="password" name="pma_password" id="pma_password" value="" />
        <input type="text" name="server" value="1" />
        <input type="text" name="target" value="index.php" />
    </form>
    location / {
        sub_filter_types text/xml text/plain application/json application/javascript;  
        sub_filter  '127.0.0.1' 'www.domain.com';
        sub_filter_once off;  
        proxy_pass http://127.0.0.1:8888;
    }
  • 写回答

1条回答 默认 最新

  • Leglo_ 2022-01-04 17:30
    关注

    非ssr(客户端浏览器渲染)时不通过nginx服务请求

    评论

报告相同问题?

问题事件

  • 修改了问题 1月4日
  • 修改了问题 1月4日
  • 创建了问题 1月4日