Is this Nethserver module helpful to you?
Please consider donating to the author

Thank you kindly!

2019/03/04 12:06 · HF

Nginx (reverse proxy webserver)

Nginx is a very flexible reverse proxy and a web server.

mrmarkuz repo is required for installation/updates.

Install nethserver-nginx:

yum -y --enablerepo=mrmarkuz install nethserver-nginx

Drop your conf files to /etc/nginx/conf.d/

Following config reverse proxies https://test1.example.com:444 to http://192.168.0.1 and https://test2.example.com:444 to http://192.168.0.3. The NethServer certificate is used.

server {
    listen 444;
    server_name test1.example.com;
    ssl_certificate           /etc/pki/tls/certs/localhost.crt;
    ssl_certificate_key       /etc/pki/tls/private/localhost.key;
    ssl on;
    location / {
        proxy_pass http://192.168.0.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;
    }
}

server {
    listen 444;
    server_name test2.example.com;
    ssl_certificate           /etc/pki/tls/certs/localhost.crt;
    ssl_certificate_key       /etc/pki/tls/private/localhost.key;
    ssl on;
    location / {
        proxy_pass https://192.168.0.3/;
        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;
    }
}

Please raise Issues on NethServer Community