nginx用戶轉到kangle

nginx用戶轉到kangle要注意的一些對應概念。 php

  • 通常咱們在nginx裏面使用php是使用fastcgi接口和php通訊。其中php進程是由第三方管理如spawn-fcgi與PHP-FPM進行管理。nginx自己不處理php的進程。這部分kangle也是能夠同樣,不做處理。

nginx核心配置

server
 {
   listen       80;
   server_name  www.kanglesoft.com;
   index index.html index.htm index.php;
   root  /data0/htdocs/blog;
   location ~ .*\.php$
   {      
     fastcgi_pass  127.0.0.1:9000;
     fastcgi_index index.php;
     include fcgi.conf;
   }
}

kangle的對應配置

<?xml version="1.0" encoding="utf-8"?>
<config>
 <server name='php' proto='fastcgi' host='127.0.0.1' port='9000' life_time='0' />
 <vh name='www.kanglesoft.com' doc_root='/data0/htdocs/blog' inherit='off'>
   <index file='index.html'/>
   <index file='index.htm'/>
   <index file='index.php'/>
   <map file_ext='php' extend='server:php' allow_method='*'/>
   <bind>!*:80</bind>
   <host>www.kanglesoft.com</host>
 </vh>
</config>
  • 一個<vh>下面能夠包含多個<bind>和<host>。實現綁定多個端口和多個域名。<host>域名也支持泛域名*.kanglesoft.com

把這個文件存到kangle/ext目錄下,文件名不限制,使用 html

kangle -r

從新加載便可。 nginx

反向代理參考

相關文章
相關標籤/搜索