【发布时间】:2021-06-20 16:52:22
【问题描述】:
我一直在摸索如何使用 ProxyPass 让 mysite.com/things 指向我在 localhost:3000 上运行的网络应用程序(已验证运行)。
我已经通过运行 a2enmod 启用了所需的模组(并验证它们正在运行)。
sudo a2enmod proxy
sudo a2enmod proxy_http
我的虚拟主机文件:
<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.mysite.com
ProxyPass /things/ http://localhost:3000
ProxyPassReverse /things/ http://localhost:3000
DocumentRoot /var/www/production/mysite
<Directory /var/www/production/mysite>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/mysite.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/mysite.log combined
</VirtualHost>
用这个重启服务器只会让它离线。事实上,它会使所有在此服务器上运行的站点脱机。删除 ProxyPass 部件使其再次工作。不知道我在这里做错了什么?我有什么遗漏吗?
【问题讨论】:
标签: apache ubuntu server proxy proxypass