In my previous question here nginx resolve (point) everything to different ip except specific file and subdirectory I asked about resolving my whitelabel website and it's pages to different ip but keep some subfolders and files on my server to load from. It turns out it's quite simple to do it and final solution went out like this:
location /robots.txt {
alias {DOCROOT};
}
server_name {SERVERNAME};
location ~ /\.php$ {
proxy_pass 10.10.10.10 <== whitelabel ip;
proxy_set_header Host {SERVERNAME};
proxy_set_header X-Forwarded-For myaccount.whitelabelsite.com;
proxy_redirect off;
proxy_set_header Connection "Keep-Alive";
proxy_buffering off;
}
So here I load everything from my whitelabel website under my domain but still keep robots.txt to load from my hosting and some other files.
The problem now is that I'm using this method I can't login to my account on whitelabel site.
So {SERVERNAME}
directive is basically my domain name mydomain.com
and when I try to login to mydomain.com/aff/panel
it opens the page, it doesn't output any error but just refreshes the page and does nothing. Same goes if someone wants to make a booking or send an email form. It opens pages but doesn't do any actions actually.
When I was using DNS redirection everything worked but now it's not. Am I missing some proxy information or headers post/get actions forwarded to and from whitelabel?