Nginx reverse proxy - no GUI

Started by Singman, October 19, 2024, 02:20:05 PM

Previous topic - Next topic
Hi,

I have 2 web servers on my LAN, they should dispatched by a classic Nginx setup like :

server {
    listen 80;
    server_name web1.domain.eu;

    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://<host1>:80;
    }
}

server {
    listen 80;
    server_name web2.domain.eu;

    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://<host2>:80;
    }
}


How to included that config on OPNSense Nginx configuration ? How to preserve it when the module will be updated ? There is no GUI for that kind of rules in web interface.


Thanks, i will make some tests with that.