Magento behind elb


Apache to use proxy

Apache will doesn't know who connects to it except the host ip address we set up nginx. To repair this, we need to install Apache's mod_rpaf. Use your favorite package manager to install libapache2-mod-rpaf:

sudo apt-get install libapache2-mod-rpaf

mod_rpaf requires the following directives inside a virtual host to work:
# Detect the ELB header and set the header magento expects
SetEnvIf X-Forwarded-Proto https HTTPS=on

<IfModule rpaf_module>
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 10.131.9.144
RPAFheader X-Client-IP
</IfModule>


Where RPAFproxy_ips can be multiple IP addresses, one of which is our Nginx proxy private IP address.