【发布时间】:2021-01-31 21:42:06
【问题描述】:
我使用 bitnami 的节点图像在 AWS Lightsail 上创建了一个实例。
我安装并启动了我的应用程序,根据我找到的指南配置了所有内容,例如:host public node js website on amazon AWS LightSail without Bitnami
由于某种原因,我没有bitnami-apps-prefix.conf,所以我创建了它,然后将它包含在/opt/bitnami/apache2/conf/bitnami/bitnami.conf 中。
重新启动 Apache,它工作正常。
之后,我使用提供的 bncert-tool 安装了 ssl 证书。添加证书后,我的域具有 ssl 但我无法再访问我的应用程序,我得到默认页面,与实例启动后立即得到的页面相同:
我检查了一下,似乎bitnami.conf 仍然包含我添加的bitnami-apps-prefix.conf
我尝试在虚拟主机中添加代理作为第一件事,但它没有帮助。
这是我的/opt/bitnami/apache2/conf/bitnami/bitnami.conf 文件:
# Default Virtual Host configuration.
# Let Apache know we're behind a SSL reverse proxy
SetEnvIf X-Forwarded-Proto https HTTPS=on
<VirtualHost _default_:80>
DocumentRoot "/opt/bitnami/apache/htdocs"
# BEGIN: Configuration for letsencrypt
Include "/opt/bitnami/apps/letsencrypt/conf/httpd-prefix.conf"
# END: Configuration for letsencrypt
# BEGIN: Support domain renewal when using mod_proxy without Location
<IfModule mod_proxy.c>
ProxyPass /.well-known !
</IfModule>
# END: Support domain renewal when using mod_proxy without Location
# BEGIN: Enable HTTP to HTTPS redirection
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^localhost
RewriteCond %{HTTP_HOST} !^[0-9]+.[0-9]+.[0-9]+.[0-9]+(:[0-9]+)?$
RewriteCond %{REQUEST_URI} !^/\.well-known
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
# END: Enable HTTP to HTTPS redirection
<Directory "/opt/bitnami/apache/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# Error Documents
ErrorDocument 503 /503.html
#Bitnami applications installed with a prefix URL (default)
Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
# BEGIN: Support domain renewal when using mod_proxy within Location
<Location /.well-known>
<IfModule mod_proxy.c>
ProxyPass !
</IfModule>
</Location>
# END: Support domain renewal when using mod_proxy within Location
</VirtualHost>
Include "/opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf"
我在这里缺少什么?为什么请求没有重定向到我的应用程序?
【问题讨论】:
标签: amazon-web-services apache bitnami amazon-lightsail