我在使用nginx和 fastcgi部署Catalyst应用程序时遇到问题。我试图在Ubuntu 12.04下做到这一点。nginx和催化剂配置
我已成功配置nginx以便从我的 应用的/ root子目录中提供静态内容。但是,当我尝试使用我的动态 网址时,我在应用程序的错误日志中收到404错误,说没有找到 (未映射的)url,这导致我相信nginx是 试图服务类似于一个静态页面,而不是 发送给我的催化剂应用程序。
要重申,打击“本地主机:3001 /根/ static.html”在 静态的内容结果成功地显示在浏览器,但 打的“localhost:30001 /费用/编辑器”导致以下错误:
"GET /expense/editor HTTP/1.1" 404
(其中“/费用/编辑器”在我的应用程序,一个运行内置的催化剂的开发 服务器时,我可以 成功访问路径)。
我推出了Catalyst应用为:
> perl script/budgetweb_fastcgi.pl -l localhost:3003
我也尝试运行/etc/init.d/fcgiwarp。我不清楚,如果我需要运行一个 单独的fastcgi包装,或者如果以上的perl脚本是我的fastcgi 包装。我编辑fcgiwrap以使用TCP套接字(127.0.0.1:3003),然后 阻止我同时运行/etc/init.d/fcgiwrap和 脚本/ budgetweb_fastcgi.pl,因为它们都使用 相同插座。所以我猜我只能使用催化剂 脚本?另外,在运行fcgiwrap时,当尝试访问静态内容时,我收到502“错误网关”错误 。
任何帮助,或指导帮助,将不胜感激。到目前为止,我已经看了看下面的页面(除其他外,StackOverflow上只允许我发布两条链路):
Catalyst wiki
HOWTO: Deploy a Catalyst application using FastCGI and nginx
这里是服务器我nginx的配置文件:
server {
listen 3001;
server_name budgetweb.com;
root /local/www/money/budgetweb;
location /root {
add_header Cache-control public;
root /local/www/money/budgetweb/;
}
location/{
access_log /local/www/money/budgetweb/logs/access.log;
error_log /local/www/money/budgetweb/logs/error.log;
index index.html index.htm index.pl;
try_files $uri =404;
gzip off;
fastcgi_pass localhost:3003;
fastcgi_index index.pl;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /local/www/money/budgetweb$fastcgi_script_name;
fastcgi_param SCRIPT_NAME /;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
# Disable gzip (it makes scripts feel slower since they have to complete
# before getting gzipped)
gzip off;
# include /etc/nginx/fcgiwrap.conf;
}