Apache Proxy在本地重定向到错误的域

时间:2019-03-07 20:25:57

标签: macos apache nginx proxy

我有一个旧网站在Apache(:8080)上运行,我想代理Nginx(:80)托管的新系统。

<VirtualHost *:8080>
    DocumentRoot "/Users/patrick/project-old"
    ServerName projectold.localhost

    ProxyPreserveHost On
    ProxyRequests Off
    ProxyPass "/products/manager" "http://projectsnew.localhost/products/manager"
    ProxyPassReverse "/products/manager" "http://projectsnew.localhost/products/manager"
</VirtualHost>

在nginx中,我有这个:

server {
    listen       80;
    server_name localhost;
    ...
}

server {
    listen       80;
    server_name projectnew.localhost;
    ...
}

当我访问 http://projectold.localhost/products/manager时,apache将我重定向到 http://localhost 而不是 http://productnew.localhost

但是,如果我从Nginx中删除 localhost.conf ,那么一切都会很好。

我的配置出了什么问题?

0 个答案:

没有答案