如何配置应用程序通过 apache2 中的代理服务器发送请求

时间:2021-07-20 09:40:57

标签: apache2 reverse-proxy

我使用 reactjs 完成了一个应用程序。每个请求都使用后面的代理服务器发送到后端。在开发环境下运行正常,没有出现任何问题。

但是当我尝试在 ubuntu 中使用 apache2 将代码发布到生产环境时,代理调用没有被正确调用

这是我的虚拟主机配置

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/example.com/build
    ServerName example.com
    ServerAlias www.example.com
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    ProxyPreserveHost On
    ProxyPass "/graphql" "https://proxyserver.com/graphql"
    ProxyPassReverse "/graphql" "https://proxyserver.com/graphql"
</VirtualHost>

我是不是配置有问题?

0 个答案:

没有答案