永久黄网站色视频免费直播,yy6080三理论日本中文,亚洲无码免费在线观看视频,欧美日韩精品一区二区在线播放

Board logo

標(biāo)題: [求助] nginx下如何綁定二級(jí)域名到子目錄? [打印本頁]

作者: paya    時(shí)間: 2012-3-11 12:33     標(biāo)題: nginx下如何綁定二級(jí)域名到子目錄?

      用wdcp建站時(shí),會(huì)自動(dòng)生public_html目錄。這個(gè)目錄下面有三個(gè)子目錄,分別是a,b,c,目前想讓a.***.com綁定a子目錄,b,c也類似設(shè)置,請(qǐng)問要如何設(shè)置?
查了許多資料,說是要改.conf 文件,在文件管理里點(diǎn)nginx,也找到文件,但不知道應(yīng)該添加什么。
感謝。

  1. server {
  2.         listen       80;
  3.         server_name ***.com www.***.com *.***.com;
  4.         root /mnt/sdb1/web/bbq/public_html;
  5.         index  index.html index.php index.htm;
  6.         error_page  400 /errpage/400.html;
  7.         error_page  403 /errpage/403.html;
  8.         error_page  404 /errpage/404.html;
  9.         error_page  405 /errpage/405.html;
  10.         location ~ \.php$ {
  11.                 fastcgi_pass   127.0.0.1:9000;
  12.                 fastcgi_index  index.php;
  13.                 include fcgi.conf;
  14.         }
  15.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
  16.                 expires      1d;
  17.         }
  18.         location ~ .*\.(js|css|html|htm)?$ {
  19.                 expires      12h;
  20.         }
  21. }        
復(fù)制代碼

作者: paya    時(shí)間: 2012-3-11 12:39

定義兩個(gè)不同的server分別指定不同的目錄

是這么弄嗎?我嘗試一下。
作者: paya    時(shí)間: 2012-3-11 12:41

沒想到,自己研究成功了,感謝度娘。
作者: paya    時(shí)間: 2012-3-11 12:49

象下面這樣設(shè)置是不是不對(duì)?
  1. server {
  2. listen 80;
  3. server_name ***.com www.***.com *.***.com;
  4. root /mnt/sdb1/web/bbq/public_html;
  5. index index.html index.php index.htm;
  6. error_page 400 /errpage/400.html;
  7. error_page 403 /errpage/403.html;
  8. error_page 404 /errpage/404.html;
  9. error_page 405 /errpage/405.html;
  10. location ~ \.php$ {
  11. fastcgi_pass 127.0.0.1:9000;
  12. fastcgi_index index.php;
  13. include fcgi.conf;
  14. }
  15. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
  16. expires 1d;
  17. }
  18. location ~ .*\.(js|css|html|htm)?$ {
  19. expires 12h;
  20. }
  21. }

  22. server {
  23. listen 80;
  24. server_name bbs.***.com;
  25. root /mnt/sdb1/web/bbq/public_html/bbs;
  26. index index.html index.php index.htm;
  27. error_page 400 /errpage/400.html;
  28. error_page 403 /errpage/403.html;
  29. error_page 404 /errpage/404.html;
  30. error_page 405 /errpage/405.html;
  31. location ~ \.php$ {
  32. fastcgi_pass 127.0.0.1:9000;
  33. fastcgi_index index.php;
  34. include fcgi.conf;
  35. }
  36. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
  37. expires 1d;
  38. }
  39. location ~ .*\.(js|css|html|htm)?$ {
  40. expires 12h;
  41. }
  42. }
復(fù)制代碼

作者: paya    時(shí)間: 2012-3-11 22:12

其實(shí)面板上面就可以綁定的,暈。
放松一下,果然還是有好處的。
作者: admin    時(shí)間: 2012-3-11 22:34

現(xiàn)在才發(fā)現(xiàn)?呵呵




歡迎光臨 WDlinux官方論壇 (http://www.fsowen.com/bbs/) Powered by Discuz! 7.2