开发者

How can I redirect ports in Cherokee?

I've installed cherokee and am very happy with it. But now I'm wondering how I can redirect ports. I'd like to开发者_Go百科 redirect port 80 to other ports based on the hostname, as follows:

Request for http://a.mysite.com to http://mysite.com:8000

Request for http://b.mysite.com to http://mysite.com:9000

All help is appreciated.

Thanks a lot!


Good! Found out myself! :)

To redirect http://a.mysite.com to http://mysite.com:8000 follow these steps in the cherokee admin web environment:

  • First create a virtual server with name a.mysite.com and give it a document root, e.g. /var/www/a.

  • Then link to the sources tab and create a new information source by clicking the 'plus' icon. Enter a.mysite.com as nick and mysite:8000 as connection.

  • Go back to the vServers tab. After making sure that the a.mysite.com server is selected check that the host match method is set to 'match nickname'.

  • In the behaviour tab select the 'default' directory and in the handler tab select 'HTTP Reverse Proxy' from the handler dropdown list. Then select 'Round Robin' as balancer in the Back-end Server section.

  • In the section Assign Information Sources section select a.mysite.com as application server.

  • Then save and restart Cherokee.

You can preform the same process for b.mysite.com.

Or, when your site becomes more popular, you can add more application servers to a.mysite.com .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜