如何配置lighttpd以服务于django静态文件?
我有一个使用Django 2.0.5制作的web应用程序,安装在Debian 9的虚拟环境中,我在其中安装了Gunicorn和lighttpd。 我在/opt/djangoproject/mywebapp中安装了我的web应用程序。 我配置了lighttpd,将这些行添加到lighttpd.conf中如何配置lighttpd以服务于django静态文件?,django,gunicorn,lighttpd,Django,Gunicorn,Lighttpd,我有一个使用Django 2.0.5制作的web应用程序,安装在Debian 9的虚拟环境中,我在其中安装了Gunicorn和lighttpd。 我在/opt/djangoproject/mywebapp中安装了我的web应用程序。 我配置了lighttpd,将这些行添加到lighttpd.conf中 $HTTP["url"] !~ "/static" { proxy.server = ( "" => ( ( "host" => "192.168.1.15", "port" =&g
$HTTP["url"] !~ "/static" {
proxy.server = ( "" => ( (
"host" => "192.168.1.15",
"port" => 8001
) ) )
}
alias.url = ( "/static/" => "/opt/djangoproject/mywebapp/mystaticfiles" )
问题是别名只在端口80上工作,而不是在8001上工作
更新:我忘了指定:
- Gunicorn仅在192.168.1.15:8001上运行(使用此静态ip)
- Lighttpd在端口80上运行(默认端口)
- Debian安装在一台服务器上,我必须从连接在同一网络上的每台设备访问它
我希望它对某人有用。您好,我更新了我的问题:gunicorn运行在特定的IP(服务器的静态IP,192.168.1.15)上,我必须从连接到网络的每个设备访问它。Lighttpd在默认端口80上运行。我不明白如何配置lighttpd.conf来截获端口8001而不是端口80上的“/static/”请求。