#StackBounty: #nginx #proxy #reverse-proxy #proxypass #resolve can't login or doing any action when using proxy_pass with nginx

Bounty: 50

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 eveerything from my whitelabel website under my doman but still keep robots.txt to load from my hosting and some other files.

Problem now is that 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 refresh page and do nothing. Same goes if someone want to make booking or send 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 informations or headers post/get actions forwarded to and from whitelabel?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.