浏览到类似的根域https://sub.example.com
并浏览诸如https://sub.example.com/page1
作品之类的页面。
但只有当我从根目录启动初始连接时才会出现这种情况。如果我在 URL 为 时刷新浏览器https://sub.example.com/page1
,则会得到 404:
无法获取/page1
我怀疑这与一些初始 SSL 握手有关,但我对这个主题不够熟悉,无法真正弄清楚我应该在哪里查找。我尝试了许多不同的站点.conf
文件,但都没有成功。在我的开发环境中使用基本 HTTP 访问运行良好。
这是我尝试过的基本配置文件:
<VirtualHost sub.example.com:80>
ServerName sub.example.com
<Location />
ProxyPass http://localhost:3020/
ProxyPassReverse http://localhost:3020/
</Location>
RewriteEngine on
RewriteCond %{SERVER_NAME} =sub.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost sub.example.com:443>
ServerName sub.example.com
SSLEngine on
SSLProxyEngine On
ProxyRequests On
<Location />
ProxyPass http://localhost:3020/
ProxyPassReverse http://localhost:3020/
</Location>
SSLCertificateFile /etc/letsencrypt/live/sub.example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sub.example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/sub.example.com/chain.pem
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://localhost:3020%{REQUEST_URI} [P]
</VirtualHost>