nginx 配置多个主机
来源:互联网 发布:加速度传感器数据分析 编辑:程序博客网 时间:2024/05/06 23:12
<pre name="code" class="html"> server { listen 8001; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /var/www/zjzc-web-frontEnd; index index.html; } location /backoffice { root /var/www/; index index.html index.htm; }location /zjzc-hy-front { root /var/www/; index index.html index.htm; }location /zjzc-hy-web-admin { root /var/www/; index index.html index.htm; }zjtest7-frontend:/var/www/zjzc-web-frontEnd# curl http://192.168.32.76:8001/backoffice/hello backoffcezjtest7-frontend:/var/www/zjzc-web-frontEnd# curl http://192.168.32.76:8001/zjzc-hy-front/hello zjzc-hy-frontzjtest7-frontend:/var/www/zjzc-web-frontEnd# curl http://192.168.32.76:8001/zjzc-hy-web-admin/hello zjzc-hy-web-adminzjtest7-frontend:/var/www/zjzc-web-frontEnd# curl http://192.168.32.76:8001/test jj 20160823结合haproxy 跳转:acl mgr_req path_beg -i /backofficeuse_backend mgrserver_8001 if mgr_reqacl mgr_req path_beg -i /zjzc-hy-frontuse_backend mgrserver_8001 if mgr_reqacl mgr_req path_beg -i /zjzc-hy-web-adminuse_backend mgrserver_8001 if mgr_reqacl url_static path_end .html .gif .png .jpg .css .jsuse_backend mgrserver_8001 if url_static default_backend mgrserver_8001 zjtest7-haproxy:/root# curl http://www.zjtest7.com/backoffice/hello backoffcezjtest7-haproxy:/root# curl http://www.zjtest7.com/backoffice/hello backoffcezjtest7-haproxy:/root# curl http://www.zjtest7.com/zjzc-hy-front/hello zjzc-hy-frontzjtest7-haproxy:/root# curl http://www.zjtest7.com/zjzc-hy-web-admin/hello zjzc-hy-web-adminzjtest7-haproxy:/root# curl http://www.zjtest7.com/test jj 20160823location ^~ /t/ { root /www/root/html/;}如果一个请求的URI是/t/a.html时,web服务器将会返回服务器上的/www/root/html/t/a.html的文件。
0 0
- nginx 配置多个主机
- Nginx一个IP配置多个主机
- nginx 同一个IP上配置多个HTTPS主机
- nginx 同一个IP上配置多个HTTPS主机
- 多主机nginx的配置参考
- tomcat配置多个主机头
- 一个主机nginx绑定多个SSL证书(https)
- docker nginx实现一个主机部署多个站点
- Nginx配置多个证书
- nginx 配置多个目录
- nginx 多个站点配置
- nginx配置多个tomcat
- nginx配置多个站点
- Nginx(10) nginx 配置多个server,多个端口
- linux centos nginx 配置虚礼主机
- linux centos nginx 配置虚礼主机
- Nginx配置之虚拟化主机
- 配置Nginx Web服务器及虚拟主机主机
- 2016年10月22日上午图片加载
- VR优化
- JDBC操作数据库的批处理
- 适应式导航
- UVA 11992 Fast Matrix Operations(线段树+延迟标记)
- nginx 配置多个主机
- 【总结】NOIP复赛来袭,各种算法经验大杂烩
- linux下建立tcp连接(connect)非常慢的问题的排查
- PLSQL-流程控制与流程循环
- JDBC调用存储过程
- Elastic-Job开发指南
- C++标准库学习记录
- Android中的进程是什么概念?
- leetcode 312. Burst Balloons