0

我使用以下配置将 nginx 配置为反向代理:

www.mydomain.com --> drupal.mydomain.com

www.mydomain.com/store --> magento.navionics.com

Drupal(网站)

location / {
            proxy_pass         http://10.21.120.12/;
            proxy_redirect     http://10.21.120.12/ http://$server_name/;
            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
            client_max_body_size       50m;
            client_body_buffer_size    128k;
            proxy_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;
            proxy_buffer_size          4k;
            proxy_buffers               4 32k;
            proxy_busy_buffers_size     64k;
            proxy_temp_file_write_size 64k;
    }

Magento

    location /store {
            proxy_pass         http://10.192.134.10/;
            proxy_redirect     http://10.192.134.10/ http://$server_name/store/;
            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
            client_max_body_size       50m;
            client_body_buffer_size    128k;
            proxy_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;
            proxy_buffer_size          4k;
            proxy_buffers               4 32k;
            proxy_busy_buffers_size     64k;
            proxy_temp_file_write_size 64k;

当我尝试 www.mydomain.com 时,我可以看到 drupal 网站。

当我尝试 www.mydomain.com/store 或 www.mydomain.com/store/ 我收到错误

"Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects."  
4

1 回答 1

2

Magento 总是重定向到每个商店的 config/web 中输入的路径。

如果您尝试重写我的任何 nginx/apache/xyz 规则,magento 将再次重写它......因此正在创建 inifnite 循环。

在其 config/web 设置中为您的 magento 商店设置正确的路径,它将正常工作。

于 2013-07-15T13:33:01.540 回答