我正在尝试使用以下功能启动小型debian服务器并运行它:
到目前为止,mailcow(和反向代理)引起了问题。
我有以下设置:
http(s)://(www.)domain.tld
正在运行到/var/www/
,运行正常。 http和https都显示我目录中的同一页面。而且我没有收到任何SSL错误。
我尝试安装mailcow,并且一直有效,直到尝试运行反向代理为止。
关于我的设置:
000-default.conf:
<VirtualHost *:80>
ServerName mail.domain.tld
ServerAlias autodiscover.*
ServerAlias autoconfig.*
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R=301,L]
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "http"
RewriteCond %{SERVER_NAME} =autoconfig.* [OR]
RewriteCond %{SERVER_NAME} =autodiscover.* [OR]
RewriteCond %{SERVER_NAME} =mail.domain.tld
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName mail.domain.tld
ServerAlias autodiscover.*
ServerAlias autoconfig.*
ProxyPass /Microsoft-Server-ActiveSync http://127.0.0.1:8080/Microsoft-Server-ActiveSync connectiontimeout=4000
ProxyPassReverse /Microsoft-Server-ActiveSync http://127.0.0.1:8080/Microsoft-Server-ActiveSync
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "https"
SSLCertificateFile /etc/letsencrypt/live/mail.domain.tld/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mail.domain.tld/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
和mailcow.conf
:
MAILCOW_HOSTNAME=mail.domain.tld
HTTP_PORT=8080
HTTP_BIND=127.0.0.1
HTTPS_PORT=8443
HTTPS_BIND=127.0.0.1
当尝试导航到https://mail.domain.tld
时,我得到的信息是SSL证书正在运行(基于chrome的详细信息),但我也得到服务不可用