OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Web Proxy Filtering and Caching (Moderator: fabian) »
  • Nginx reverse proxy - no GUI
« previous next »
  • Print
Pages: [1]

Author Topic: Nginx reverse proxy - no GUI  (Read 294 times)

Singman

  • Newbie
  • *
  • Posts: 24
  • Karma: 0
    • View Profile
Nginx reverse proxy - no GUI
« on: October 19, 2024, 02:20:05 pm »
Hi,

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

Code: [Select]
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.
Logged

Fright

  • Hero Member
  • *****
  • Posts: 1777
  • Karma: 164
    • View Profile
Re: Nginx reverse proxy - no GUI
« Reply #1 on: October 20, 2024, 12:12:36 pm »
hi
try to use opnsense_stream_vhost_plugins folder for the file with your custom config
https://github.com/opnsense/plugins/blob/3c5e2b9d771bf8e7145eb659f1d8a4302640cc62/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf#L69C1-L69C18
Logged

Singman

  • Newbie
  • *
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Nginx reverse proxy - no GUI
« Reply #2 on: October 20, 2024, 02:18:08 pm »
Thanks, i will make some tests with that.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Web Proxy Filtering and Caching (Moderator: fabian) »
  • Nginx reverse proxy - no GUI
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2