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

Thank you kindly!

2019/03/04 06:06 · HF

Nginx

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

mrmarkuz repo

mrmarkuz repo is required for installation/updates.

NethServer-nginx

Install nethserver-nginx:

yum -y install nethserver-nginx

Usage

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

Example

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