我用virtualmin与apache为我的其他网站。
Apache监听一端口8080清漆端口80挂接端口443对话端口8081
默认值低于**。vcl**文件,我的其他apache站点没有任何问题。虽然话语站点开放,但存在着很多问题。
- 徽标未显示,附件不起作用。
我试图打开强制HTTPS选项在管理面板的话语,但有了这个,没有用户可以登录到网站。
我的清漆配置:
vcl 4.1;
import std;
# Default backend definition. Set this to point to your content server.
backend default {
.host = "192.168.1.103";
.port = "8080";
}
backend discourse {
.host = "192.168.1.103";
.port = "8081";
}
sub vcl_recv {
if (req.http.host == "discourse.example.com") {
set req.backend_hint = discourse;
return (pipe);
} else {
set req.backend_hint = default;
}
if (std.port(server.ip) != 443) {
set req.http.location = "https://" + req.http.host + req.url;
return(synth(301));
}
if (!req.http.X-Forwarded-Proto) {
if(std.port(server.ip) == 443) {
set req.http.X-Forwarded-Proto = "https";
} else {
set req.http.X-Forwarded-Proto = "https";
}
}
}
sub vcl_backend_response {
# Happens after we have read the response headers from the backend.
#
# Here you clean the response headers, removing silly Set-Cookie headers
# and other mistakes your backend does.
}
sub vcl_synth {
if (resp.status == 301 || resp.status == 302) {
set resp.http.location = req.http.location;
return (deliver);
}
}
sub vcl_deliver {
# Happens when we have all the pieces we need, and are about to send the
# response to the client.
#
# You can do accounting or modifying the final object here.
}
**我在话语应用程序中的变化。联系我们
expose:
- "8081:80" # http
# - "443:443" # https
## Uncomment these two lines if you wish to add Lets Encrypt (https)
# - "templates/web.ssl.template.yml"
# - "templates/web.letsencrypt.ssl.template.yml"
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
# LETSENCRYPT_ACCOUNT_EMAIL: me@example.com
我的hitch配置更改:
pem-file = "/home/discourse/ssl.everything"
帮助我解决这个问题。
1条答案
按热度按时间mxg2im7a1#
哼
我的第一个猜测是你的话语结构。我不知道该软件,但如果你的错误是像HTTP 404的标志和附件,可能是一个错误的话语配置。也可以解决
http.x-forwarded-host = www.example.com ;
关于VCL的一些事情。...真的很困惑
最后,下面的代码可能是一个足够的工作配置