cs.domain.com proxy not working

rpr

Verified User
Joined
Oct 20, 2010
Messages
65
cp.domain.com proxy not working

Hi,

I've used the following tutorial:
https://help.directadmin.com/item.php?id=84

So I've added
Code:
server {
   listen 1.2.3.4:80;
   server_name cp.domain.com;

   include /etc/nginx/webapps.conf;

   location / {
       proxy_pass       http://myserver.domain.com:2222/;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   }
}
to /etc/nginx/nginx-includes.conf

restarted nginx.
I see the login page.
But when I login I get redirected to cp.domain.com:2222

In the log /var/log/directadmin/login it says:
2017:06:15-15:17:36: '127.0.0.1' successful login to 'admin' after 1 attempts

If I login on the 2 second page I get logged in of course.

Anyone has a solution for this?
 
Last edited:
That is already changed.
In my test a get a simi working result when I replace the $host with the FQDN of my server. Where $host is cp.domain.com and my FQDN is webserver.domain.com
I can logon then but not every image load fine:
directadminerror.png
and as soon as I click on an url, I have to logon again.
 
Both vars aren't in the directadmin.conf.
Wil check the url a bit later today and give feedback.

Thx for the help!
 
The x_forwarded_from_ip= makes it "work"
What I mean is that I can logon using cp.domain.com but as soon as I am logged in the url is cp.domain.com:2222
Is this normal?
 
Back
Top