Solved Use Nginx_Apache as reverse proxy to other server / other port

heybuddy

Verified User
Joined
Mar 28, 2022
Messages
41
Hello,

I am planning to use NGINX_APACHE as a REVERSE PROXY for my app in other server.

My App is hosted on sub.domain.tld port 9898.
The problem is, the port 9898 does not provide SSL but I want to access sub.domain.tld with SSL.

So, in Directadmin I setup a LETSENCRYPTSSL, and this is my NGINX custom HTTPD:
Code:
|?PROXY_IP=sub.domain.tld|
|?PORT_8081=9898|

Now, accessing https://sub.domain.tld will show 502 Bad Gateway.
in contrary, accessing with http://sub.domain.tld will show the App page just without SSL though I did not setup PORT_8080 (only port 8081).

Is this still doable, could someone guide me please.

Thanks
 
Last edited:
Hi,
Thanks for your guide.

It does the same like my previous method.

Now when I visit the domain, I only greeted with default DirectAdmin page:
Something amazing will be constructed here...

Second, how to reverse proxy to SSL with this method?

Last, how to revert the changes? @zEitEr

Thanks again.
 
Last edited:
There is a difference. The method from the post suggests a full rewriting:

Code:
|?PROXY_PASS=http://127.0.0.1:2121/
 
There is a difference. The method from the post suggests a full rewriting:

Code:
|?PROXY_PASS=http://127.0.0.1:2121/
Hi,

Okay, understood.

I'm still can't connect to an HTTPS app, can Directadmin acts as bridge between app and visitor as well?


Can these changes be reverted to its original state?
 
Hi @zEitEr

Please ignore my previous post.
Your guide is the answer.

With my first method, I will always get error 502 for HTTPS (don't know why).

I was also forgot to add outgoing port to the CSF.

Now I can Proxy to any non SSL port and Directadmin will help add SSL to it.

Now I will mark the Thread as Solved.
 
Back
Top