我在Lighttpd服务器上使用FastCGI设置了Django。问题是,当我向“.html”页面发出请求时,FastCGI服务器而不是常规的“lighttpd”服务器会收到请求。虽然该文件存在,但它无法提供服务。
以下是我的Lighttpd配置:
$HTTP["host"] =~ "192\.168\.1\.198:8093" {
fastcgi.server = (
".fcgi" => (
"192\.168\.1\.198" => (
"bin-path" => "/django_projects/myproject/myproject.fcgi",
"socket" => "/tmp/myproject.sock",
"check-local" => "disable",
"min-procs" => 1,
"max-procs" => 3,
)
),
".py" => (
"192\.168\.1\.198" => (
"bin-path" => "/django_projects/myproject/myproject.fcgi",
"socket" => "/tmp/myproject.sock",
"check-local" => "disable",
"min-procs" => 2,
"max-procs" => 3,
)
),
)
alias.url = (
"/media" => "/usr/lib/python2.6/site-packages/django/contrib/admin/media/",
"/static" => "/var/www/static/",
"/cgi-bin/" => "/var/www/cgi-bin/",
)
url.rewrite-once = (
"^(/media.*)$" => "$1",
###"^(/static.*)$" => "$1",
"^/favicon\.ico$" => "/media/favicon.ico",
"^(/.*)$" => "/myproject$1",
)
}
如果我将我的html放在“静态”文件夹中并将其放入配置中(如上面的注释代码所示),那么我的html页面可以很好地提供。
我唯一需要的是我不想为html页面设置单独的文件夹。我目前希望我的脚本和html位于同一个文件夹中。
我该怎么做?提前谢谢。