以下配置只针对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. String Method的字符串变换的一个例子

    <!DOCTYPE html> <html lang="en"><head> <meta charset="UTF-8" ...

  2. 安装mysql以及遇到的问题解决

    首先把我使用的8.0.15版本的MySQL发上来,有需要的可以下载. 链接:https://dev.mysql.com/downloads/mysql/ 安装MySQL: 第一步:将压缩包解压后,手动 ...

  3. amazeUI的confirm控件记录缓存问题的解决办法

    场景:列表行每行都有删除按钮,点击删除按钮将行记录的id传给js方法,js方法中调用amazeui的confirm控件,确认删除function通过ajax执行删除行为. 问题现象:每次删除列表第一行 ...

  4. HBase原理和设计

    转载 2016年1月10日:http://www.sysdb.cn/index.php/2016/01/10/hbase_principle/ 简介 架构 数据组织 原理 RS定位 region写入 ...

  5. pivot 与 unpivot 函数是SQL05新提供的2个函数

    pivot 与 unpivot 函数是SQL05新提供的2个函数   ----------------------------------------------------------------- ...

  6. 移动端调用ArcGIS Server 10.1服务

    1.最好用mdb数据源,不要用shp文件作为数据源,一是属性字段长度超过5个字符会被截断,二是中文会变成乱码. 2.mxd的layer的坐标系要是WGS1984(4362),不然属性查询不出来.

  7. 将简单Excel表格显示到DataGridView中

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  8. 20155219付颖卓《网络对抗》EXP7网络欺诈技术防范

    实验后回答问题 1.通常在什么场景下容易受到DNS spoof攻击 在公共共享网络里,并且同一网段可以ping通的网络非常容易被攻击. 2.在日常生活工作中如何防范以上两攻击方法 不在不信任的公开网络 ...

  9. window下mysql创建库只读

    window下mysql创建库只读和启动失败都有可能是my.ini配置文件出错的问题 遇到如下错误ERROR 1036 (HY000): Table 'schemata' is read only,办 ...

  10. 百战程序员——Spring框架

    什么是容器,我们学过了哪些容器,Spring与我们之前学习的容器有哪些异同点? 容器可以管理对象的生命周期.对象与对象之间的依赖关系,您可以使用一个配置文件(通常是XML),在上面定义好对象的名称.如 ...