【发布时间】:2022-08-04 15:03:39
【问题描述】:
有 vhost 配置,它应该是烧瓶应用程序的反向代理,并且不工作。下面是虚拟主机配置。 Flask 应用程序正在端口 5000 上运行。
在上下文和外部都添加了重写,即使那样它也不起作用。下面的配置总是给出错误 500。
vhDomain $VH_NAME
vhAliases www.$VH_NAME
enableGzip 1
enableIpGeo 1
index {
useServer 0
indexFiles index.php, index.html
}
errorlog $VH_ROOT/logs/$VH_NAME.error_log {
useServer 0
logLevel WARN
rollingSize 10M
}
accesslog $VH_ROOT/logs/$VH_NAME.access_log {
useServer 0
logFormat \"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"\"
logHeaders 5
rollingSize 10M
keepDays 10
compressArchive 1
}
extprocessor pythonflask1709 {
type proxy
address 127.0.0.1:5000
maxConns 200
pcKeepAliveTimeout 60
initTimeout 20
retryTimeout 0
respBuffer 0
}
scripthandler {
add proxy:pythonflask1709 html
}
module cache {
storagePath /usr/local/lsws/cachedata/$VH_NAME
}
rewrite {
enable 1
autoLoadHtaccess 1
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
REWRITERULE ^(.*)$ HTTPS://127.0.0.1:5000/$1 [P]
}
context / {
type proxy
handler pythonflask1709
addDefaultCharset off
rewrite {
enable 1
autoLoadHtaccess 1
RewriteEngine On
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
REWRITERULE ^(.*)$ HTTP://127.0.0.1:5000/$1 [P]
}
}
标签: vhosts cyber-panel