Home Linux & Systems Cybersecurity Cloud & DevOps Networks & Infrastructure SIEM & Monitoring DFIR & Threat Intel Development & Other All categories Projects About Tools

Reverse Proxy Configuration with Apache in GNU/Linux

Leer en espanol
Reverse Proxy Configuration with Apache in GNU/Linux

Table of contents

A Reverse Proxy is an intermediary between a public network and a set of private servers; which is responsible for managing service requests by you ===

What is a reverse proxy?

A Reverse Proxy is an intermediary between a public network and a set of private servers; which is responsible for managing service requests from one or more external computers. These work by manipulating HTTP requests that are sent by various computers; in a process in which requests are attended to and at the same time they manipulate the presentation of these services to avoid compromising critical information from the group of private servers where they are requested.

Diagram:

Dmz proxyanon 718x367

Facility:

Derivatives in debian.

text
aptitude install -y libapache2-mod-proxy-html libxml2-dev apache2 openssl

Red hat derivatives

Bash
yum install httpd mod_ssl -y

Derivatives in debian.

Bash
vi /etc/apache2/sites-enabled/reverse_proxy.conf

Red hat derivatives

Bash
vi /etc/httpd/conf.d/reverse_proxy.conf

Configuration:

In my case, the port through which the web server hosted on the internal network is operating is 9443, therefore I will perform this configuration on this port.

Apache
#Redirigimos todo el trafico http a https
NameVirtualHost *:9443
<VirtualHost *:9443>
RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>
#Realizamos la configuración del proxy inverso
<IFModule mod_proxy.c>
<VirtualHost *:9443>
ServerAdmin rokitoh@red-orbita.com
ServerName reverseproxy.red-orbita.com
ServerAlias redorbitaapp01.red-orbita.com
ProxyPass /  http://192.168.20.1:9443/
ProxyPassReverse /  http://192.168.20.1:9443/
ProxyRequests Off
ProxyPreserveHost On
#Configuramos  el certificado:
SSLEngine on
SSLProxyEngine on
SSLCertificateFile /etc/httpd/certs/redorbita.crt
SSLCertificateKeyFile /etc/httpd/certs/redorbita.key
#Configuramos los permiosos
<proxy>
Order deny,allow
Allow from all
</proxy>
</VirtualHost>
</IFModule>

We exit saving the configuration file and restart the service

Derivatives in debian.

Bash
service apache restart

Red hat derivatives

Bash
service httpd  restart

:wq!

Comments