以下配置只针对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. 解决Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.geek.dao.ContentDao.Integer

    mybatis报错:Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain val ...

  2. Linux "ls -l"文件列表权限详解 【转】

    1.使用 ls -l 命令 执行结果如下(/var/log) : drwxr-x--- 2 root              adm    4096 2013-08-07 11:03 apache2 ...

  3. 在Linux服务器上使用Vbox安装虚拟机

    先去官网(www.virtualbox.org)上下载对应Linux系统的Vbox版本. 我这边用的是Oracle Linux 7系统(KDE安装) 使用rpm安装virtualbox 发现报错,按照 ...

  4. 利用toggle实现背包

    1.先创建入如图所示界面 2.在图片下面创建一个选中状态图片 3.在normal图片添加toggle组件,将子物体拖动到graphic里

  5. 编辑器测试-TinyMCE

    一级标签 二级便签 引用段落1231456456 普通段落 链接 简书 https://www.jianshu.com/p/edee77363855 import pygame WINWIDTH = ...

  6. mysql数据库的备份

    有时会遇到需要重装虚拟机的情况,这时候之前创建好的数据库就需要备份啦,等重新装好虚拟机直接导入就可以正常使用. 数据库备份大体分为两步: 第一步.导出数据库,因为是备份,会将所有的数据库导出,因此需要 ...

  7. 2018-计算机系机试(第二批)-C-数字字符个数

    C. 数字字符个数 单点时限: 1.0 sec 内存限制: 256 MB 输入一行信息,输出其中包含的数字字符个数. 例如:输入 a<4 >w,输出 1 . 输入格式 一行字符串 (可能含 ...

  8. osgi Quick Start

    今天有空看了下osgi,根据官网的说明来快速搭建一个服务,把步骤记下来. (官网地址:https://enroute.osgi.org/tutorial/020-tutorial_qs.html) 一 ...

  9. gulp在项目中的基本使用

    在项目中用gulp做项目的代码的管理,用起来很方便.主要用到了下面一些功能 关于js的处理,包括合并.压缩.加hash. 关于css的处理,编辑scss,合并css,加hash,自动加入前缀 本地开发 ...

  10. RxJS核心概念之Subjet在angular2+上的应用

    Subject,在RxJS中是一类特殊的Observable(可观察对象),它可像多个Observer(观察者)推送值.每一个Subject也可以作为Observer(观察者) Subject同样也是 ...