› NGINX
› NGINX Trac
› 3rd Party Modules
› Security Advisories
› CHANGES
› OpenResty
› ngx_lua
› Tengine
在线学习资源
› NGINX 开发从入门到精通
NGINX Modules
› ngx_echo
holinhot
V2EX  ›  NGINX

nginx 反代能不能在 head 里插入一段 js

  •  
  •   holinhot · May 26, 2015 · 6089 views
    This topic created in 4184 days ago, the information mentioned may be changed or developed.

    header_string 好像插入的是最前面 都在html外了
    怎么能插入<head></head>之间

    11 replies  •  2015-08-19 08:37:01 +08:00
    server
    server
    May 26, 2015
    1
    记得伟大的Apache是可以,nginx没耍过。
    101
    101
    May 26, 2015
    2
    可以,不过默认的功能不强,有第三方模块,搜索一下就能搞定
    holinhot
    holinhot
    OP
    May 26, 2015
    3
    @server
    @101
    把</head>替换成
    xxxxxxxxxxxxxxxxxxxx</head>可行吗
    fising
    fising
    May 26, 2015
    4
    当然可以。
    101
    101
    May 26, 2015
    5
    可以啊 关键字 subs_filter
    GG668v26Fd55CP5W
    GG668v26Fd55CP5W
    May 26, 2015 via iPhone
    6
    nginx有替代模块
    phithon
    phithon
    May 26, 2015
    8
    sub_filter </head> "<script>xxx</script></head>"
    phithon
    phithon
    May 26, 2015
    9
    不过要先把gzip关掉
    proxy_set_header Accept-Encoding "";
    sub_filter </head> "<script>xxx</script></head>"
    dallaslu
    dallaslu
    May 26, 2015
    10
    可以 +1
    sky170
    sky170
    Aug 19, 2015 via iPhone
    11
    可以,但是有些会乱
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1513 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 15:05 · PVG 23:05 · LAX 07:05 · JFK 10:05
    ♥ Do have faith in what you're doing.