I am having an issue with my load balancer health checks. It is attempting to access the server hosting the Magento 2 site. When I curl the IP address of the machine I get the following Response Headers:
curl -i xxx.xxx.xxx (ip address of the server)
HTTP/1.1 302 Found
Location: https://www.example.com/?SID=79561247abvhemu78nosr0u32l
....
It appears to be redirecting to the domain set inside the Magento2 configuration.
I have read about the SID
value. I am not sure if this is causing the redirect but the site will be a multi store site so I would like to keep the SID
enabled.
The issue is that when the Load Balancer hits the server I am getting a 302
which causes the health check to fail.
I am unsure of what is causing this redirect and how to best get the health check to pass.
Update
I have confirmed that it is Magento doing the redirect and not the web server. If I remove index.php
and replace it with a new php file (Not running Magento) I get a 200 response. So it appears that something in the codebase is creating the redirect.
I ran bin/magento config:show
and it returned the following:
web/seo/use_rewrites - 1
web/unsecure/base_url - https://www.example.com/
web/unsecure/base_static_url -
web/unsecure/base_media_url -
web/unsecure/base_link_url - https://www.example.com/
web/secure/base_url - https://www.example.com/
web/secure/use_in_frontend - 0
web/secure/use_in_adminhtml - 0
web/secure/base_static_url -
web/secure/base_media_url -
web/default/cms_home_page - home
web/cookie/cookie_path -
web/cookie/cookie_domain -
web/cookie/cookie_httponly - 1
web/url/use_store - 0
web/url/redirect_to_base - 0
...
...
...
Plus a lot more config settings, that seemed irrelevant.