【问题标题】:Using ProxyPass takes server offline使用 ProxyPass 使服务器脱机
【发布时间】: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


    【解决方案1】:

    您的配置看起来不错,但没有任何错误日志,就无法找出问题所在。另外不要忘记启用并保护 balanceManager (https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html#manager)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-10
      • 1970-01-01
      • 2016-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多