Centos 7 proxy only on certain ports.

Issues related to configuring your network
Post Reply
alexboyer
Posts: 7
Joined: 2017/08/30 00:23:04

Centos 7 proxy only on certain ports.

Post by alexboyer » 2017/08/30 15:56:40

Okey so basically i have a Apache server running with MySQL, mariadb, phpmyadmin. And at the same time i have remote desktop enabled on port 3389. What i was hoping to do it configure a proxy so my web server goes through a dedicated proxy but my remote desktop port is not affected by the proxy. Just for security reasons that if someone port scans my web server ip address then they cannot see that there is the remote desktop port open. Can someone please explain how to configure this? Im no expert haha... Just a noob trying to learn ;)

Thanks,
-Klaus

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Centos 7 proxy only on certain ports.

Post by aks » 2017/08/30 16:19:36

I'm not really sure what you want, but I think you want another machine which has the public facing IP address (i.e.: routable) attached to it, running Apache HTTPD (so similar) with mod_proxy. That means to the outside world your web server is the Apache server running mod_proxy, but it's not really, it's the other server.
There is some great documentation about mod_proxy, just Google it.
This is not 100%, as an attacker can "detect" proxies by things like timing attacks, mis-configuration (like passing the X-ForwardedFor header to the client) and so on.

alexboyer
Posts: 7
Joined: 2017/08/30 00:23:04

Re: Centos 7 proxy only on certain ports.

Post by alexboyer » 2017/08/30 16:51:36

Lets forget about the remote desktop thing for now.
I was looking at this tutorial (http://www.ehowstuff.com/apache-reverse ... for-linux/) .

My next question is that in the reverse_proxy.conf file you past code that includes:
"ProxyPass"
"ProxyPassReverse"
Is that where i put my proxy ip that i bought?
For example "Proxypass 235.231.643.245:8080"
Can you name any reliable proxy services?

Sorry for asking so basic questions haha,
Im just really new to proxy's.
Thank,
-Klaus

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Centos 7 proxy only on certain ports.

Post by aks » 2017/08/31 16:22:19

Yes:

ProxyPass /<end_url> https://<web_server_address>:<port_of_webserver>/<end_url>
ProxyPassReverse /<end_url> https://<web_server_address>:<port_of_webserver>/<end_url>

Example:

URL1 is: example.com/MyApp
URL2 is: example.com/MyOtherApp
Internet DNS points example.com IP address
Actual web server is listening on: 192.168.1.1:443 for HTTPS.

ProxyPass /MyApp https://192.168.1.1:443/MyApp
ProxyPassReverse /MyApp https://192.168.1.1:443/MyApp
ProxyPass /MyOtherApp https://192.168.1.1:443/MyOtherApp
ProxyPassReverse /MyOtherApp https://192.168.1.1:443/MyOtherApp

You probably could get away with not specifying the port in the above example, because it is HTTPS & the "default" port for HTTPS is 443, I just wanted to be clear.
Note this is for Apache, for Nginx, it's slightly different.

Post Reply