日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Nginx虛擬機(jī)如何安裝和使用

Nginx 虛擬機(jī)使用是廣大管理員需要掌握的相關(guān)問題,在使用中相關(guān)的問題需要我們不斷學(xué)習(xí)和掌握,下面我們就詳細(xì)的看看有關(guān)的問題。在Nginx 虛擬機(jī)中用多個(gè)子域名,每個(gè)子域名到不同的目錄。

創(chuàng)新互聯(lián)建站專業(yè)為企業(yè)提供臨澧網(wǎng)站建設(shè)、臨澧做網(wǎng)站、臨澧網(wǎng)站設(shè)計(jì)、臨澧網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)與制作、臨澧企業(yè)網(wǎng)站模板建站服務(wù),十多年臨澧做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。

如:

 
 
 
  1. http {   
  2. server {   
  3. listen 80;   
  4. server_name a.chenlb.com;   
  5. access_log logs/a.access.log main;   
  6. server_name_in_redirect off;   
  7. location / {   
  8. index index.html;   
  9. root /home/www/host_a/;   
  10. }   
  11. }   
  12. server {   
  13. listen 80;   
  14. server_name b.chenlb.com;   
  15. access_log logs/b.access.log main;   
  16. server_name_in_redirect off;   
  17. location / {   
  18. index index.html;   
  19. root /home/www/host_b/;   
  20. }   
  21. }   
  22. }   
  23. http {  
  24. server {  
  25. listen 80;  
  26. server_name a.chenlb.com;  
  27. access_log logs/a.access.log main;  
  28. server_name_in_redirect off;  
  29. location / {  
  30. index index.html;  
  31. root /home/www/host_a/;  
  32. }  
  33. }  
  34. server {  
  35. listen 80;  
  36. server_name b.chenlb.com;  
  37. access_log logs/b.access.log main;  
  38. server_name_in_redirect off;  
  39. location / {  
  40. index index.html;  
  41. root /home/www/host_b/;  
  42. }  
  43. }  

結(jié)果發(fā)現(xiàn)用 b.chenlb.com 還是指到 host_a 目錄。后來看了官方示例:http://wiki.Nginx.org/NginxVirtualHostExample,提到有個(gè) default 的匹配,如:

 
 
 
  1. http {   
  2. server {   
  3. listen 80 default;   
  4. server_name _;   
  5. access_log logs/default.access.log main;   
  6. server_name_in_redirect off;   
  7. location / {   
  8. index index.html;   
  9. root /var/www/default/htdocs;   
  10. }   
  11. }   
  12. }   
  13. http {  
  14. server {  
  15. listen 80 default;  
  16. server_name _;  
  17. access_log logs/default.access.log main;  
  18. server_name_in_redirect off;  
  19. location / {  
  20. index index.html;  
  21. root /var/www/default/htdocs;  
  22. }  
  23. }  

加上這個(gè) default 就可使 a.chenlb.com 和 b.chenlb.com 正常工作了。以上就是Nginx 虛擬機(jī)的詳細(xì)介紹。


分享題目:Nginx虛擬機(jī)如何安裝和使用
文章網(wǎng)址:http://www.5511xx.com/article/dpihgce.html