Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Issues when behind a reverse proxy
 
bopfer
Jr. Member
 
Total Posts:  14
Joined:  2007-10-25
 

I am trying to set up Magento behind a reverse proxy and I have run into an issue.  The URI path for the store is not the same as the file system path on the server. When Magento tries to redirect to a secure URL, it uses the file system path instead of the URI path.

Example:

Store is located at: http://www.foobar.com/baz/ecommerce/, which on the filesystem is in the directory DOCUMENT_ROOT/12345/

12345 is the id of the ‘baz’ store and a reverse proxy server(mod_rewrite) handles the details.

If I click on the “Login” link, it tries to redirect to https://www.foobar.com/12345/customer/account/ instead of https://www.foobar.com/baz/ecommerce/customer/account/

So, it’s using the real file system path, instead of the ‘web/secure/base_path’ in core_config_data

My first question is: Is this a bug?  seems to me like it should use the ‘web/secure/base_path’.

Second question: Where in the code is that redirect happening so I can mess with it?

Thanks,
Bryan

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

The filesystem folder configuration is separated from web path.

Take a look in your db table core_config_data:

select from core_config_data where path like 'web/%/base_path';
will show you your web base path value.

While this statement

select from core_config_data where path like 'system/filesystem/%';
will show you the directories configuration.
 
Magento Community Magento Community
Magento Community
Magento Community
 
harjot
Member
 
Total Posts:  61
Joined:  2007-11-13
 

I had the same problem. I was wondering how i would change the path of the magento website using the same mysql database to a different url on the same host and access log. Plus is there a easy way to delete the Default stores.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bopfer
Jr. Member
 
Total Posts:  14
Joined:  2007-10-25
 

I guess my point is that when doing the redirect to a secure url, shouldn’t it use the web base paths and not the file system paths?

My web base path values are all proper and start with ‘/baz/ecommerce/’, so if it redirected based on those, it seems that everything would work fine.

-Bryan

 
Magento Community Magento Community
Magento Community
Magento Community
 
bopfer
Jr. Member
 
Total Posts:  14
Joined:  2007-10-25
 

Any replies to my second question?

Where in the code is that redirect happening so I can mess with it?

I have been looking around, but I haven’t found it yet.

-Bryan

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

The verification for secure/unsecure request happens in app/code/core/Mage/Core/Controller/Router/Standard.php around line 106 in 0.6.13700

 
Magento Community Magento Community
Magento Community
Magento Community
 
bopfer
Jr. Member
 
Total Posts:  14
Joined:  2007-10-25
 

Thanks for the direction.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bopfer
Jr. Member
 
Total Posts:  14
Joined:  2007-10-25
 

Looks like the problem is in Zend.  The file lib/Zend/Controller/Request/Http.php sets the requestUri and it doesn’t take into account a webserver behind an apache/mod_rewrite proxy. hmm…

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top