I have separated our magento setup into load balanced frontend servers and a single admin backend server. I have specified : web/url/redirect_to_base = 0
and have setup the custom admin url in database.
The access to magento admin panel works fine at http://admin.magento.com/customadminpath
but the homepage url http://admin.magento.com/
now shows the webstore frontend which is not what I wanted.
How can I redirect any requests for homepage on admin server to the admin url with admin path?
I have tried putting rewrites in nginx but couldn't get it to work. What I'm trying to setup here is any requests to admin.magento.com
should be redirected to admin.magento.com/customadminpath
so that no one can access the frontend pages on admin.magento.com
.
Also, what's the correct approach for this, through nginx configuration or change in the index script?