以下配置只针对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. vs code 本地请求json

    首先下载扩展live server 重新加载后 右下方工具栏会多出一个go live 点击go live,会默认启动chome,地址  http://127.0.0.1:5500 js脚本: $.aj ...

  2. oracle 表空间不足处理

    linux环境将*.dmp文件导入数据库时,df  -h 发现测试环境虚拟机空间不足,而数据文件xxx.dbf所占空间达到40G左右,果断删除表空间重建在导入. 一.查出存储数据表空间名称 selec ...

  3. npm ERR! Unexpected end of JSON input while parsing near...错误

    问题解决方案在GitHub中: https://github.com/vuejs-templates/webpack/issues/990 总结一下:1.删除package-lock.json 2.进 ...

  4. oracle的PDB启动

    /*以管理员身份登录*/sqlplus / as sysdba /*查看CDB的状态*/select status from v$instance; /*开启startup,默认是open*/star ...

  5. CCF CSP 201803-3 URL映射

    转载自 https://blog.csdn.net/tigerisland45/article/details/81697594 /* CCF201803-3 URL映射 */ #include &l ...

  6. Day01_Python学习今日收获

    1.关键字 break:终止本层循环,即如果是双层嵌套循环,那么就终结最内层循环 注意:如果在for或while循环中终止,他们任何对应的else语句块也将不执行. 2.关键字continue:跳过当 ...

  7. 元组tuple 可迭代对象

    1. 字符串.元组和列表相互转化 s = 'abcdef' li = ['a','b','c','d'] tu = (1,2,4,9) v = tuple(s) print('v = ',v) w = ...

  8. Django 1.9 + celery + django-celry 实现定时任务

    celery可以进行任务异步处理,celery还有一种Celery的常用模式便是执行定期任务. 执行定期任务时, Celery会通过celerybeat进程来完成. Celerybeat会保持运行, ...

  9. python 类的定义 实例化 实例完后初始化

    先来看看 类的__init__, 类的__new__ , 元类的__new__的执行顺序 class TMetaclass(type): def __new__(cls,name,bases,attr ...

  10. Simple circos code

    According to the tutorials (http://circos.ca/documentation/tutorials/), to draw a graph using circos ...