opnsense / opnsense/plugins

[os-OPNWAF] Allow multiple hostnames / ServerAlias entries per Virtual Server

Aperta
#5,653 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@Monviech ci sta già lavorando.

Dal 20/8/2026.

feature
Lingua principale
PHP
Stelle
1.2k
Fork
863
Merge medio
2g 6h
PR unite (30g)
10

Descrizione

[os-OPNWAF]: Allow multiple hostnames / ServerAlias entries per Virtual Server

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.

Currently, an OPNWAF Virtual Server is limited to a single hostname. For example, if the same web application should be accessible through both example.com and www.example.com, it is necessary to create two separate Virtual Servers, even though both hostnames share the exact same backend, TLS configuration, WAF configuration and routing rules.

This results in duplicated configuration and increases maintenance overhead. This is a common use case for web applications where both the www and non-www variants of a hostname are accepted and one of them is subsequently redirected to the canonical hostname.

Describe the solution you'd like

Allow a single OPNWAF Virtual Server to contain multiple hostnames. For example:

Virtual Server
    Server Name:                            example.com
    Additional Hostnames / Server Aliases:  www.example.com
    Backend:                                192.168.10.50:443

This could be implemented using Apache's ServerAlias directive:

<VirtualHost *:443>
    ServerName example.com
    ServerAlias www.example.com
</VirtualHost>

The GUI could either provide a dedicated "Additional Hostnames" field or allow the hostname field to accept multiple entries.

Expected behavior

A single Virtual Server should be able to accept requests for multiple hostnames while sharing the same:

  • backend / real server
  • TLS certificate (the certificate must cover all configured hostnames, e.g. via a wildcard or SAN certificate)
  • WAF policy
  • locations
  • authentication configuration
  • security settings

If different behavior is required for a specific hostname, users can still create separate Virtual Servers as they do today.

Describe alternatives you've considered

Creating separate Virtual Servers for each hostname works, but results in duplicated configuration and increases the risk of configuration drift between Virtual Servers that are supposed to behave identically.

Manually modifying the generated Apache configuration is not desirable, as such changes are outside the GUI and may be overwritten when the configuration is regenerated.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.