zoukankan      html  css  js  c++  java
  • nginx 配置多个主机

    <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 backoffce
    zjtest7-frontend:/var/www/zjzc-web-frontEnd# curl http://192.168.32.76:8001/zjzc-hy-front/
    hello zjzc-hy-front
    zjtest7-frontend:/var/www/zjzc-web-frontEnd# curl http://192.168.32.76:8001/zjzc-hy-web-admin/
    hello  zjzc-hy-web-admin
    zjtest7-frontend:/var/www/zjzc-web-frontEnd# curl http://192.168.32.76:8001/
    test  jj 20160823
    
    
    结合haproxy 跳转:
    acl             mgr_req                 path_beg                -i                      /backoffice
    use_backend     mgrserver_8001          if                      mgr_req
    
    
    acl             mgr_req                 path_beg                -i                      /zjzc-hy-front
    use_backend     mgrserver_8001          if                      mgr_req
    
    acl             mgr_req                 path_beg                -i                      /zjzc-hy-web-admin
    use_backend     mgrserver_8001          if                      mgr_req
    
    acl             url_static              path_end                .html .gif .png .jpg .css .js
    use_backend     mgrserver_8001          if                      url_static
    
      default_backend mgrserver_8001
    
      
      
    zjtest7-haproxy:/root# curl http://www.zjtest7.com/backoffice/
    hello backoffce
    zjtest7-haproxy:/root# curl http://www.zjtest7.com/backoffice/
    hello backoffce
    zjtest7-haproxy:/root# curl http://www.zjtest7.com/zjzc-hy-front/
    hello zjzc-hy-front
    zjtest7-haproxy:/root# curl http://www.zjtest7.com/zjzc-hy-web-admin/
    hello  zjzc-hy-web-admin
    zjtest7-haproxy:/root# curl http://www.zjtest7.com/
    test  jj 20160823
    
    location ^~ /t/ {
         root /www/root/html/;
    }
    如果一个请求的URI是/t/a.html时,web服务器将会返回服务器上的/www/root/html/t/a.html的文件。


    
       
    
    
  • 相关阅读:
    sqlISNULL函数(转载)
    sql数据导入导出(转载)
    sqlbcp
    SQL连接方式(左连接、右连接、全连接)转载
    陶哲轩实分析 习题 7.2.6 (嵌套级数)
    陶哲轩实分析 命题7.2.5 证明
    陶哲轩实分析 定义 7.2.1(形式无限级数) 的一点注记
    陶哲轩实分析 推论 7.3.2 (比较判别法) 证明
    陶哲轩实分析 习题 7.2.6 (嵌套级数)
    陶哲轩实分析 命题 7.2.14 (极限算律) 证明
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199066.html
Copyright © 2011-2022 走看看