繁体   English   中英

从 apache 到 nginx 的 Proxypass 和反向代理

[英]Proxypass and reverse proxy from apache to nginx

我有子域网站http://subdomain.mywebsite.com/path ,它托管在 Siteground 上并在 nginx 服务器上运行。 我希望用户应该能够通过主网站 URL 访问上述路径或其子路径,比如在 apache 服务器上运行的http://mywebsite.com/path

我尝试在我的主网站上的 apache 配置文件中使用以下代理传递和反向代理传递:-

<Location "/path">
        ProxyPass "http://subdomain.mywebsite.com/path"
        ProxyPassReverse "http://subdomain.mywebsite.com/path"
    </Location>

当我访问页面http://mywebsite.com/path时,我得到 404 页面的站点,而使用http://subdomain.mywebsite.com/path可以直接访问相同的路径。

我一直在努力寻找解决方案,但无法让它发挥作用。

您可以使用以下配置:

ProxyPass /path http://subdomain.mywebsite.com/path
ProxyPassReverse /path http://subdomain.mywebsite.com/path

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM