国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > Nginx > 正文

Nginx 如何添加虛擬主機(jī)

2024-08-30 12:24:05
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
 兩個(gè)虛擬主機(jī),純靜態(tài)
  1. http {  
  2.   index index.html;  
  3.    
  4.   server {  
  5.     server_name www.domain1.com;  
  6.     access_log logs/domain1.access.log main;  
  7.    
  8.     root /var/www/domain1.com/htdocs;  
  9.   }  
  10.    
  11.   server {  
  12.     server_name www.domain2.com;  
  13.     access_log  logs/domain2.access.log main;  
  14.    
  15.     root /var/www/domain2.com/htdocs;  
  16.   }  

A Default Catchall Virtual Host

 

  1. http {  
  2.   index index.html;  
  3.    
  4.   server {  
  5.     listen 80 default;  
  6.     server_name _;  
  7.     access_log logs/default.access.log main;  
  8.    
  9.     server_name_in_redirect off;  
  10.    
  11.     root  /var/www/default/htdocs;  
  12.   }  

指定所有的二級(jí)域名

 

  1. server {  
  2.   # Replace this port with the right one for your requirements  
  3.   listen 80 [default|default_server];  #could also be 1.2.3.4:80  
  4.    
  5.   # Multiple hostnames separated by spaces.  Replace these as well.  
  6.   server_name star.yourdomain.com *.yourdomain.com; # Alternately: _  
  7.    
  8.   root /PATH/TO/WEBROOT/$host;  
  9.    
  10.   error_page 404 errors/404.html;  
  11.   access_log logs/star.yourdomain.com.access.log;  
  12.    
  13.   index index.php index.html index.htm;  
  14.    
  15.   # serve static files directly  
  16.   location ~* /.(jpg|jpeg|gif|css|png|js|ico|html)___FCKpd___2nbsp;{  
  17.     access_log off;  
  18.     expires max;  
  19.   }  
  20.    
  21.   location ~ /.php___FCKpd___2nbsp;{  
  22.     include fastcgi_params;  
  23.     fastcgi_intercept_errors on;  
  24.     # By all means use a different server for the fcgi processes if you need to  
  25.     fastcgi_pass   127.0.0.1:YOURFCGIPORTHERE;  
  26.   }  
  27.    
  28.   location ~ //.ht {  
  29.     deny  all;  
  30.   }  

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 合川市| 平度市| 板桥市| 乌拉特后旗| 水富县| 凤凰县| 郑州市| 新乡县| 隆化县| 奉新县| 蒲城县| 江达县| 彰化市| 翁牛特旗| 上杭县| 来凤县| 海兴县| 嘉义县| 黄陵县| 皮山县| 临夏县| 容城县| 泾川县| 沅陵县| 和平区| 威海市| 洛南县| 界首市| 湘潭市| 灵山县| 乐都县| 神池县| 和林格尔县| 隆昌县| 赫章县| 定结县| 同德县| 温泉县| 长宁区| 韶山市| 措美县|