全球主机交流论坛

标题: substitutions4nginx替换脚本 [打印本页]

作者: loveminds    时间: 2012-5-15 11:39
标题: substitutions4nginx替换脚本
帮忙写一下脚本(带/和不带/只可能有一种情况出现)
把页面中的/head.htm和head.htm替换为http://127.0.0.1/head.js
把页面中的/end.htm和end.htm替换为http://127.0.0.1/end.js
作者: geyunbing    时间: 2012-5-15 11:43
提示: 作者被禁止或删除 内容自动屏蔽
作者: 查无此人    时间: 2012-5-15 11:56
提示: 作者被禁止或删除 内容自动屏蔽
作者: 查无此人    时间: 2012-5-15 11:57
提示: 作者被禁止或删除 内容自动屏蔽
作者: loveminds    时间: 2012-5-15 12:03
subs_filter '/head.htm' 'http://127.0.0.1/head.js' gi;   这样?
作者: loveminds    时间: 2012-5-15 12:12
本帖最后由 loveminds 于 2012-5-15 12:14 编辑

    server {
        listen       80;
        server_name  inlibrary.gd;
        access_log  logs/host.access.log  main;
        location / {
            root   html;
            index  index.html index.htm;
        }

    server {
            listen        81;
        server_name  opac.inlibrary.gd;
            location / {
                proxy_pass              http://10.1.40.173/;
                proxy_redirect          off;
                proxy_set_header        X-Real-IP       $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                }
        subs_filter_types       text/html;
        subs_filter '/head.htm' 'http://127.0.0.1/head.js' gi;
        subs_filter '/end.htm' 'http://127.0.0.1/end.js' gi;
        }

这个存在什么问题,为什么会nginx: [emerg] "server" directive is not allowed here in ./nginx/conf/nginx.conf:48?(81端口反向由48行开始)
作者: loveminds    时间: 2012-5-15 15:12
呼叫夜姐
作者: Kvm    时间: 2012-5-15 15:15
小白路过 求带




欢迎光临 全球主机交流论坛 (https://d.168530.xyz/) Powered by Discuz! X3.4