以下配置只针对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

Nginx reverse proxy NSQAdmin的更多相关文章

  1. Nginx应用-Location路由反向代理及重写策略 请求转发-URL匹配规则 NGINX Reverse Proxy

    NGINX Docs | NGINX Reverse Proxy https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/ ...

  2. Nginx & Reverse Proxy

    Nginx & Reverse Proxy https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/ https:/ ...

  3. 正向代理 forward proxy、反向代理 reverse proxy、透明代理 transparent proxy nginx反向代理原理和配置讲解 防止外部客户机获取内部内容服务器的重定向 URL 缓存命中

    [大型网站技术实践]初级篇:借助Nginx搭建反向代理服务器 - Edison Chou - 博客园http://www.cnblogs.com/edisonchou/p/4126742.html 图 ...

  4. Master Nginx(5) - Reverse Proxy Advanced Topics

    Security through separtion Encrypting traffic with SSL Authenticating clients using SSL Blocking tra ...

  5. 反向代理(Reverse Proxy)

    反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端,此时 ...

  6. an open source web server and reverse proxy

    https://www.nginx.com/resources/admin-guide/ NGINX is an open source web server and reverse proxy th ...

  7. 反向代理Reverse proxy

    https://www.zhihu.com/question/24723688/answer/160252724 反向代理在计算机世界里,由于单个服务器的处理客户端(用户)请求能力有一个极限,当用户的 ...

  8. 正向代理 forward proxy、反向代理 reverse proxy、透明代理 transparent proxy

    https://zh.wikipedia.org/wiki/反向代理 反向代理在计算机网络中是代理服务器的一种.服务器根据客户端的请求,从其关系的一组或多组后端服务器(如Web服务器)上获取资源,然后 ...

  9. Forward Proxy & Reverse Proxy | 正向代理 和 反向代理

    对请求和响应内容不做修改的转发的服务器,被称为代理服务器.代理服务器分为两种类型:正向代理 和 反向代理. 正向代理:面向互联网,从更广范围获取信息的代理. 反向代理:面向内部,一般用于某企业的网站的 ...

随机推荐

  1. 通过配置文件添加MIME类型

    在web.config配置文件中的configuration节点下添加如下节点: <system.webServer> <staticContent> <mimeMap ...

  2. Java学习——方法

    在这一次的学习中我觉得首先要了解: 什么是方法呢 方法又怎么定义与调用 上面这段代码是我们经常写到的,其实它就是一个方法,其中 public 是修饰符 void是返回值类型 main就是方法名 arg ...

  3. 安装mysql5.5遇到的狗屁问题,最后还是细心一下就好

    首先巩固下自己已经遗忘了一年的Mysql数据库和navicat可视化数据库,安装数据库没有具体要求直接点下一步就好,我第一次安装提示服务器名无效,后来发现了原因,mysql服务压根没有启动,也就是更直 ...

  4. python学习笔记3-函数

    一.函数高级特性 1)列表生成式,列表生成式即List Comprehensions,是Python内置的非常简单却强大的可以用来创建list的生成式. eg: >>> list(r ...

  5. python基础—字典的使用{}

    info = {'stu1':"lili", 'stu2':'yoyo', 'stu3':'dudu'}print(info)print(info['stu1'])info['st ...

  6. 2018-计算机系机试-A

    #include<stdio.h> #include<cstdio> #include<cmath> #include<cstring> #includ ...

  7. servlet之小demo(四)

    描述: 1.在web.xml文件中设置两个web应用的初始化参数,user和password 2.定义一个login.html,里面定义两个请求字段:user,password,发送请求到loginS ...

  8. mac安装brew简单方法

    安装方法:命令行输入 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/ma ...

  9. spring cloud_1_mm_ribbon

    ji接上文 ribbon做请求分发负载均衡 ribbon 配置: server.port=9999 spring.application.name=ribbon-consumer #stores.ri ...

  10. c#获取url请求的返回值

    /// <summary> /// 获取url的返回值 /// </summary> /// <param name="url">eg:http ...