【发布时间】:2020-04-23 15:45:57
【问题描述】:
我的系统由 Amazon LighSail 托管。 我的应用程序在端口 3000 上使用 Nodejs 运行。 我使用 Let's Encrypt 为我的域名安装了 HTTPS 证书。
现在我想直接访问我的 nodejs 应用程序到我的 sub-domain.domain.com。 当我转到我的域名 (sub-domain.domain.com) 时,我会被定向到 bitnami 主页。
所以我有:
https://sub-domain.domain.com --> bitnami 主页
IP-ADDRESS:3000 --> 我的 nodejs 应用程序
我添加了一个代理,将所有 HTTP 请求重定向到我的端口 3000,但没有成功。
我的代理添加到 /etc/apache2/sites-enabled/000-default.conf :
< VirtualHost *:80 >
ServerAdmin webmaster@localhost
ServerName www.sub-domain.domain.com
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
< / VirtualHost >
有人有解决我问题的想法或任何线索?
【问题讨论】:
标签: node.js apache apache2 lets-encrypt