ansible-role-nginx-config
ansible-role-nginx-config copied to clipboard
add map inside stream
Is your feature request related to a problem? Please describe
We use the stream module for reverse proxy ssl connection, so we need something like this: ` stream {
upstream web1 {
server https://thatserver.org;
}
upstream web2 {
server https://otherserver.org;
}
upstream thisone{
server https://localhost:8443;
}
map $ssl_preread_server_name $name {
thatserver.org web1;
otherserver.org web2;
default thisone;
}
server {
listen 443 ;
listen [::]:443 ;
proxy_pass $name;
ssl_preread on;
proxy_protocol on;
}
} `
AFAK, in http module there is the map statement:
map: hash_bucket_size: 128 hash_max_size: 4096 mappings: - string: $http_host variable: $name ...
But there is none in stream module.
Describe the solution you'd like
use the map in stream module as there is in http module
Describe alternatives you've considered
For now, we will use the custom_directives, or try to do it using a local branch
Additional context
Add any other context or screenshots about the feature request here.
I'll add it to the backlog! In the meantime, I would suggest using the custom_directives parameter to workaround not having map support in the stream context 😄
Yes, for now we're using the custom-directive and is working
custom_directives - map $ssl_preread_server_name $name { - example.site1.srl web1; - example.site2.srl web2; - default none; - "}"
P.S. Tab, is wrong, i could not understand how to use the "code" in markdow... sorry XD
No worries! Glad you managed to get it working!