Help with Nginx/Apache as Reverse Proxy setup

iamgavinjones

New member
Joined
Jan 2, 2023
Messages
2
Hi everyone,

I am an absolute NOOB with DirectAdmin, I recently migrated my entire hosting portfolio over to a new VPS provider and they recommended I use DirectAdmin (I've been using Cpanel for years).

I have a scenario where I am needing to redirect portal.mydomain.com or mydomain.com/portal (not sure which is easier) to my CRM Server on a public IP with a specific port xxx.xxx.xxx.xxx:yyyy

As I'm new to DirectAdmin, I am petrified of breaking any of the sites I am hosting on my server.

Any assistance will be greatly appreciated - All I have done so far is follow these steps: https://docs.directadmin.com/webservices/nginx_apache/general.html
From what I can tell, it's been installed and I have no idea what to do from this point onwards.

I appreciate your time and efforts.
 
Hi Alex,

Many thanks for your response, would you be willing to implement it with me? I would be more than happy to pay you for your time. Can we chat directly?
 
I did,
And it apparently solved my problem.

Could you suggest me any not-so-simple way, In case of me or someone in dire need to have an actual subdomain in direct admin and do the thing mentioned by the article you stated?

Thank you for your time
 
I have the following added to my /usr/local/directadmin/data/templates/custom/virtual_host2_secure.conf.CUSTOM.4.post:

# DirectAdmin PANEL

<VirtualHost |IP|:|PORT_443| |MULTI_IP|>
ServerName panel.|DOMAIN|
ServerAdmin |ADMIN|


SSLEngine on
SSLCertificateFile |CERT|
SSLCertificateKeyFile |KEY|
|CAROOT|


#ProxyRequests off
SSLProxyEngine on
ProxyPass / https://127.0.0.1:2222/
ProxyPassReverse / https://127.0.0.1:2222/
ProxyPreserveHost On


CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log

This way, every domain gets a panel hostname which forwards to your DA on your DA port (2222 or whichever port you use) on 127.0.0.1

Hope this helps.
 
Oh and in /usr/local/directadmin/data/templates/custom/virtual_host2.conf:

## PANEL VirtualHost:

<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
ServerName panel.|DOMAIN|
RewriteEngine On
RewriteRule "^/$" "https://panel.|DOMAIN|/"
</VirtualHost>
 
Hi everyone,

I am an absolute NOOB with DirectAdmin, I recently migrated my entire hosting portfolio over to a new VPS provider and they recommended I use DirectAdmin (I've been using Cpanel for years).

I have a scenario where I am needing to redirect portal.mydomain.com or mydomain.com/portal (not sure which is easier) to my CRM Server on a public IP with a specific port xxx.xxx.xxx.xxx:yyyy

As I'm new to DirectAdmin, I am petrified of breaking any of the sites I am hosting on my server.

Any assistance will be greatly appreciated - All I have done so far is follow these steps:
From what I can tell, it's been installed and I have no idea what to do from this point onwards, but I found some helpful guidance here that might point me in the right direction.

I appreciate your time and efforts.
Hello. Has anyone successfully configured an Nginx reverse proxy in front of the NextPVR web interface? Would you be willing to share your configuration? I'd even take a successful Apache config. I have configured Nginx reverse proxies in front of many web services - even difficult ones. For the life of me, I can't get this to work.
 
Hello. Has anyone successfully configured an Nginx reverse proxy in front of the NextPVR web interface? Would you be willing to share your configuration? I'd even take a successful Apache config. I have configured Nginx reverse proxies in front of many web services - even difficult ones. For the life of me, I can't get this to work.

My setup is:
  • NextPVR running on 192.168.1.100:8866 for example
  • Nginx handling SSLand proxying to
  • Accessing it through subdomain.domain.com and create the subdomain as a domain in DirectAdmin
My config:

Code:
location / {
    proxy_pass http://192.168.1.100:8866/;

    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}
 
Back
Top