wang_rx 发表于 2018-11-17 09:30:38

apache系列(虚拟域名)

  

  
    ServerAdmin webmaster@dummy-host.example.com
  

  
    DocumentRoot /home/admin_dev/lotusprize
  

  
    ServerName lotusprize.com
  

  
    ServerAlias www.lotusprize.com    #ErrorLog /home/admin_dev/lotusprize_error.logs
  

  
    #CustomLog /home/admin_dev/lotusprize_access.logs
  

  
   
  

  
      OptionsFollowSymLinks
  

  
      AllowOverride All
  

  
    Require all granted   
  

  

  

  
    #反向代理部分,需要开启proxy,proxy_http,proxy_balancer(负载均衡)等模块
  

  
    ProxyRequests Off
  

  
    ProxyPass/lp/css !
  
    ProxyPass/lp/images !#表示不代理
  

  
   ProxyPass /newchannelhttp://www.example.com/newchannel
  

  
   ProxyPa***everse /newchannelhttp://www.example.com/newchannel
  

  

  

  
    #反向代理
  

  
    ProxyPassMatch    /travel/dataUpdate(.json)?balancer://cluster/bundle-app/dataUpdate$1 nofailover=Offmaxattempts=3
  

  
   #负载均衡
  

  
   
  

  
            BalancerMember http://localhost:7000 loadfactor=1 retry=60
  

  
          BalancerMember http://localhost:8000 loadfactor=1 retry=60
  

  
          ProxySet lbmethod=byrequests   
  

  

  

  
    #反向代理
  

  
    ProxyPass /travel/bundle-app balancer://cluster/bundle-app nofailover=Offmaxattempts=3
  

  
   #加上下面这句地址栏不变化
  

  
   ProxyPa***everse /travel/bundle-app balancer://cluster/bundle-app
  

  
   
  

  
      BalancerMember http://localhost:7000 loadfactor=1 retry=60
  

  
      BalancerMember http://localhost:8000 loadfactor=1 retry=60
  

  
      ProxySet lbmethod=byrequests   
  

  
   如果多个项目负载均衡,balancer://cluster这个值是要自定义的,不能同名可以是balancer://clusterinfo等等。
  

  

  

  
    #指定别名(fpm模式下不可用,并且不可用于百度的统计子目录,需要开始alias模块)
  

  
    Alias /travel "/home/admin_dev/travel/"
  

  
   
  

  
      Options FollowSymLinks
  

  
      AllowOverride All      #Allow from All低版本配置
  

  
      #Require all granted高版本配置,本人使用的2.4
  

  
      
  
            Require all granted
  
            Require not ip 37.187.93.149 192.99.32.119 192.99.32.120 192.99.32.117
  
      
  

  
   
  



页: [1]
查看完整版本: apache系列(虚拟域名)