Re: [問題] Lighttpd的設定方式
: → ryudo:樓上的大大可以教一下如果是nginx怎樣達成本文的目的呢?3Q 10/13 19
我就不測試了,從這邊 copy 過來的:
http://github.com/godfat/source-tools/
blob/master/lib/source-tools/templates/tconfig/nginx.conf.erb
假設你的 php 目錄底下有 rails app:
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include conf/fastcgi_params;
}
# 以下這段要放在 php 之前,因為要先 match.
location ~ ^/your_rails_prefix/ {
# ...
}
我沒用過 rails fast-cgi, 你自己查查看 rails 怎麼設。
總之 fast-cgi 就參考 php 那樣設。其他的請參考 nginx wiki:
http://wiki.nginx.org/NginxConfiguration
不過我會建議你用 passenger, 或最近新的 unicorn, 或是 thin cluster.
passenger 是管理方便,thin cluster 是效能比較好。
passenger 很單純,就在 location 裡面加個:
passenger_enabled on;
rails_env production;
root /some/where/public;
unicorn 參考 github:
http://github.com/blog/517-unicorn
不過我自己是還沒試過。
--
生死去来、棚頭傀儡、一線断時、落落磊磊
《花鏡》-世阿弥
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.135.28.18
→
10/15 18:29, , 1F
10/15 18:29, 1F
→
10/15 18:30, , 2F
10/15 18:30, 2F
→
10/15 18:30, , 3F
10/15 18:30, 3F
推
10/15 23:00, , 4F
10/15 23:00, 4F
→
10/15 23:00, , 5F
10/15 23:00, 5F
→
10/19 16:29, , 6F
10/19 16:29, 6F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 4 篇):