zoukankan      html  css  js  c++  java
  • Nginx reverse proxy NSQAdmin

    以下配置只针对nsqadmin v1.1.0 (built w/go1.10.3)版本

    #
    # The default server
    #

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location /nsq/ {
            auth_basic "NSQ Administrator's Area";
            auth_basic_user_file /root/nsq/bin/.htpasswd;
            proxy_pass http://127.0.0.1:4171/;

            # proxy_redirect default;
            proxy_redirect http://127.0.0.1:4171/ /nsq/;
            proxy_set_header Accept-Encoding ""; # no compression allowed or next won't work
            sub_filter_types  *;
            sub_filter '/static/' '/nsq/static/';
            sub_filter 'return"/api' 'return"/nsq/api';
            sub_filter '<a class="navbar-brand" href="/">' '<a class="navbar-brand" href="/nsq/">';
            sub_filter 'Router.extend({routes:{"":"topics","topics/(:topic)(/:channel)":"topic",lookup:"lookup","nodes(/:node)":"nodes",counter:"counter"}' 'Router.extend({routes:{"nsq/":"topics","nsq/topics/(:topic)(/:channel)":"topic","nsq/lookup":"lookup","nsq/nodes(/:node)":"nodes","nsq/counter":"counter"}';
            sub_filter '<a class="link" href="/' '<a class="link" href="/nsq/';
            sub_filter_once off;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }

    }

    主要是因为NSQAdmin采用了backbone.js来做router

  • 相关阅读:
    build tools
    文档系统总结
    各进制及其转换详解
    JQuery 函数执行顺序
    计算页面宽高的函数
    Linq中的多表左联,详细语句
    css设置滚动条颜色与样式以及如何去掉与隐藏滚动条
    基于JQUERY写的 LISTBOX 选择器
    js/jquery 实时监听输入框值变化的完美方案:oninput & onpropertychange
    JQuery select控件的相关操作
  • 原文地址:https://www.cnblogs.com/Jerryshome/p/10270914.html
Copyright © 2011-2022 走看看