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