Hi,
I need to write a SNI Hostname Mapping containing a regex for my nginx stream config.
# upstream maps
map $ssl_preread_server_name $hostmap810accf68e0940739a1a2e6e120da638 {
~(.*).xxx.example.com upstream648aa196e04c4ad89c034af56d947d20;
default upstream99238aa963f043548157e74820e3cb70;
}
But for some reason the UI does not allow to insert something thats not a hostname.
If I change this manually in /usr/local/etc/nginx/nginx.conf and restart all is ok, so it's supported by nginx.
I searched around and tried to find whats going on here $nginx->serializeToConfig();
but I have no glue where the hostname validation is applied.
The Nginx SettingsController.php extends ApiMutableModelControllerBase but where is the assumption that hostname inside the sni_mapping_table should be a valid hostname?
https://github.com/opnsense/plugins/issues/2733
hi!
https://github.com/opnsense/plugins/blob/142ea68c0649b69df9713a900afb8406835ba770/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml#L1081
field type is defined as HostnameField so it will not allow regex
type="TextField" may work imho
Thank you! All working now. Have created a pull request to change that type.