您好,登錄后才能下訂單哦!
一般一個域名建立一個conf,然后在主域名中Include
Include conf/extra/denyip.conf
Include conf/extra/vhosts/*.conf
單個域名的配置
<VirtualHost *:80> 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 <Directory "/home/admin_dev/lotusprize"> Options FollowSymLinks AllowOverride All Require all granted </Directory> #反向代理部分,需要開啟proxy,proxy_http,proxy_balancer(負載均衡)等模塊 ProxyRequests Off ProxyPass /lp/css ! ProxyPass /lp/images ! #表示不代理 ProxyPass /newchannel http://www.example.com/newchannel ProxyPa***everse /newchannel http://www.example.com/newchannel #反向代理 ProxyPassMatch /travel/dataUpdate(.json)? balancer://cluster/bundle-app/dataUpdate$1 nofailover=Off maxattempts=3 #負載均衡 <proxy balancer://cluster> BalancerMember http://localhost:7000 loadfactor=1 retry=60 BalancerMember http://localhost:8000 loadfactor=1 retry=60 ProxySet lbmethod=byrequests </proxy> #反向代理 ProxyPass /travel/bundle-app balancer://cluster/bundle-app nofailover=Off maxattempts=3 #加上下面這句地址欄不變化 ProxyPa***everse /travel/bundle-app balancer://cluster/bundle-app <proxy balancer://cluster> BalancerMember http://localhost:7000 loadfactor=1 retry=60 BalancerMember http://localhost:8000 loadfactor=1 retry=60 ProxySet lbmethod=byrequests </proxy> 如果多個項目負載均衡,balancer://cluster這個值是要自定義的,不能同名可以是balancer://clusterinfo等等。 #指定別名(fpm模式下不可用,并且不可用于百度的統計子目錄,需要開始alias模塊) Alias /travel "/home/admin_dev/travel/" <Directory "/home/admin_dev/travel/"> Options FollowSymLinks AllowOverride All #Allow from All低版本配置 #Require all granted高版本配置,本人使用的2.4 <RequireAll> Require all granted Require not ip 37.187.93.149 192.99.32.119 192.99.32.120 192.99.32.117 </RequireAll> </Directory> </VirtualHost >
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。