nginx enabling CORS for multiple subdomainsHow do I add Access-Control-Allow-Origin in NGINX?Nginx proxy pass works for https but not httpnginx proxy redirecting request to different proxyNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx rewrite throw 404 with last and breakNginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx reverse proxy hide login query also on 301 redirect or full qualified urlnginx: CORS headers are not added for OPTIONS requestConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsNGINX virtual host config for Magento2 in a subfolder
how do we prove that a sum of two periods is still a period?
Why is the sentence "Das ist eine Nase" correct?
Car headlights in a world without electricity
Should I tell management that I intend to leave due to bad software development practices?
Does the Idaho Potato Commission associate potato skins with healthy eating?
Why are UK visa biometrics appointments suspended at USCIS Application Support Centers?
How dangerous is XSS
Do creatures with a speed 0ft., fly 30ft. (hover) ever touch the ground?
Can compressed videos be decoded back to their uncompresed original format?
How can a day be of 24 hours?
In Bayesian inference, why are some terms dropped from the posterior predictive?
In the UK, is it possible to get a referendum by a court decision?
Are British MPs missing the point, with these 'Indicative Votes'?
Could the museum Saturn V's be refitted for one more flight?
Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?
Finding the reason behind the value of the integral.
How to stretch the corners of this image so that it looks like a perfect rectangle?
How could indestructible materials be used in power generation?
Is this draw by repetition?
Notepad++ delete until colon for every line with replace all
How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?
Blending or harmonizing
Mathematica command that allows it to read my intentions
How do conventional missiles fly?
nginx enabling CORS for multiple subdomains
How do I add Access-Control-Allow-Origin in NGINX?Nginx proxy pass works for https but not httpnginx proxy redirecting request to different proxyNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx rewrite throw 404 with last and breakNginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx reverse proxy hide login query also on 301 redirect or full qualified urlnginx: CORS headers are not added for OPTIONS requestConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsNGINX virtual host config for Magento2 in a subfolder
My nginx version: nginx/1.4.6
I have an issue enabling CORS for multiple subdomains. I checked https://gist.github.com/algal/5480916 and http://rustyrazorblade.com/post/2013/2013-10-31-cors-with-wildcard-domains-and-nginx/ but both solutions doesn't work for me.
It looks like the regex
if ($http_origin ~* (.*.mydomain.com))
set $cors "true";
is not matching and $cors is not set to "true" and therefor add_header 'Access-Control-Allow-Origin' "$http_origin" won't be executed.
I also tried with regex
$http_origin ~* (https?://.*.mydomain.com)
or
$http_origin ~* https?://.*.mydomain.com
But in either case the regex doesn't match and $cors will never set to "true".
What am I missing?
My nginx configuration - domain name in curly braces (is getting replaced by Ansible):
upstream varnish
server localhost:80;
server
listen 443 default;
server_name vhost;
ssl on;
ssl_certificate /etc/ssl/certs/ssl.domain.crt;
ssl_certificate_key /etc/ssl/private/domain.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
#ssl_prefer_server_ciphers on;
# workaround remote exploit. Fixed in 1.5.0, 1.4.1
#
# http://mailman.nginx.org/pipermail/nginx-announce/2013/000112.html
if ($http_transfer_encoding ~* chunked)
return 444;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
# CORS
set $cors "";
if ($http_origin ~* (.*.domain))
set $cors "true";
location /
# Set the max size for file uploads (/admin, /webmail)
client_max_body_size 10G;
proxy_pass http://varnish;
if ($cors = "true")
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow_Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range, X-CSRF-Token';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
if ($request_method = OPTIONS)
return 204;
location = /50x.html
root html;
nginx
add a comment |
My nginx version: nginx/1.4.6
I have an issue enabling CORS for multiple subdomains. I checked https://gist.github.com/algal/5480916 and http://rustyrazorblade.com/post/2013/2013-10-31-cors-with-wildcard-domains-and-nginx/ but both solutions doesn't work for me.
It looks like the regex
if ($http_origin ~* (.*.mydomain.com))
set $cors "true";
is not matching and $cors is not set to "true" and therefor add_header 'Access-Control-Allow-Origin' "$http_origin" won't be executed.
I also tried with regex
$http_origin ~* (https?://.*.mydomain.com)
or
$http_origin ~* https?://.*.mydomain.com
But in either case the regex doesn't match and $cors will never set to "true".
What am I missing?
My nginx configuration - domain name in curly braces (is getting replaced by Ansible):
upstream varnish
server localhost:80;
server
listen 443 default;
server_name vhost;
ssl on;
ssl_certificate /etc/ssl/certs/ssl.domain.crt;
ssl_certificate_key /etc/ssl/private/domain.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
#ssl_prefer_server_ciphers on;
# workaround remote exploit. Fixed in 1.5.0, 1.4.1
#
# http://mailman.nginx.org/pipermail/nginx-announce/2013/000112.html
if ($http_transfer_encoding ~* chunked)
return 444;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
# CORS
set $cors "";
if ($http_origin ~* (.*.domain))
set $cors "true";
location /
# Set the max size for file uploads (/admin, /webmail)
client_max_body_size 10G;
proxy_pass http://varnish;
if ($cors = "true")
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow_Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range, X-CSRF-Token';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
if ($request_method = OPTIONS)
return 204;
location = /50x.html
root html;
nginx
could you show us how the config looks like when Ansible replaced the variables?
– unNamed
Mar 29 at 7:32
add a comment |
My nginx version: nginx/1.4.6
I have an issue enabling CORS for multiple subdomains. I checked https://gist.github.com/algal/5480916 and http://rustyrazorblade.com/post/2013/2013-10-31-cors-with-wildcard-domains-and-nginx/ but both solutions doesn't work for me.
It looks like the regex
if ($http_origin ~* (.*.mydomain.com))
set $cors "true";
is not matching and $cors is not set to "true" and therefor add_header 'Access-Control-Allow-Origin' "$http_origin" won't be executed.
I also tried with regex
$http_origin ~* (https?://.*.mydomain.com)
or
$http_origin ~* https?://.*.mydomain.com
But in either case the regex doesn't match and $cors will never set to "true".
What am I missing?
My nginx configuration - domain name in curly braces (is getting replaced by Ansible):
upstream varnish
server localhost:80;
server
listen 443 default;
server_name vhost;
ssl on;
ssl_certificate /etc/ssl/certs/ssl.domain.crt;
ssl_certificate_key /etc/ssl/private/domain.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
#ssl_prefer_server_ciphers on;
# workaround remote exploit. Fixed in 1.5.0, 1.4.1
#
# http://mailman.nginx.org/pipermail/nginx-announce/2013/000112.html
if ($http_transfer_encoding ~* chunked)
return 444;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
# CORS
set $cors "";
if ($http_origin ~* (.*.domain))
set $cors "true";
location /
# Set the max size for file uploads (/admin, /webmail)
client_max_body_size 10G;
proxy_pass http://varnish;
if ($cors = "true")
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow_Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range, X-CSRF-Token';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
if ($request_method = OPTIONS)
return 204;
location = /50x.html
root html;
nginx
My nginx version: nginx/1.4.6
I have an issue enabling CORS for multiple subdomains. I checked https://gist.github.com/algal/5480916 and http://rustyrazorblade.com/post/2013/2013-10-31-cors-with-wildcard-domains-and-nginx/ but both solutions doesn't work for me.
It looks like the regex
if ($http_origin ~* (.*.mydomain.com))
set $cors "true";
is not matching and $cors is not set to "true" and therefor add_header 'Access-Control-Allow-Origin' "$http_origin" won't be executed.
I also tried with regex
$http_origin ~* (https?://.*.mydomain.com)
or
$http_origin ~* https?://.*.mydomain.com
But in either case the regex doesn't match and $cors will never set to "true".
What am I missing?
My nginx configuration - domain name in curly braces (is getting replaced by Ansible):
upstream varnish
server localhost:80;
server
listen 443 default;
server_name vhost;
ssl on;
ssl_certificate /etc/ssl/certs/ssl.domain.crt;
ssl_certificate_key /etc/ssl/private/domain.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
#ssl_prefer_server_ciphers on;
# workaround remote exploit. Fixed in 1.5.0, 1.4.1
#
# http://mailman.nginx.org/pipermail/nginx-announce/2013/000112.html
if ($http_transfer_encoding ~* chunked)
return 444;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
# CORS
set $cors "";
if ($http_origin ~* (.*.domain))
set $cors "true";
location /
# Set the max size for file uploads (/admin, /webmail)
client_max_body_size 10G;
proxy_pass http://varnish;
if ($cors = "true")
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow_Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range, X-CSRF-Token';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
if ($request_method = OPTIONS)
return 204;
location = /50x.html
root html;
nginx
nginx
asked Mar 19 at 14:01
StandardNerdStandardNerd
503
503
could you show us how the config looks like when Ansible replaced the variables?
– unNamed
Mar 29 at 7:32
add a comment |
could you show us how the config looks like when Ansible replaced the variables?
– unNamed
Mar 29 at 7:32
could you show us how the config looks like when Ansible replaced the variables?
– unNamed
Mar 29 at 7:32
could you show us how the config looks like when Ansible replaced the variables?
– unNamed
Mar 29 at 7:32
add a comment |
2 Answers
2
active
oldest
votes
Try moving the check for $http_origin into your location block.
You can see the same in the first example link you gave.
The variable is probably first filled when the location block is called.
moving the check for $http_origin into your location block doesn't change anything
– StandardNerd
Mar 28 at 16:05
add a comment |
You can get around the limitation of only one subdomain by using this clever workaround that will allow all subdomains:
server
root /path/to/your/stuff;
index index.html index.htm;
set $cors "";
if ($http_origin ~* (.*.yoursweetdomain.com))
set $cors "true";
server_name yoursweetdomain.com;
location /
if ($cors = "true")
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'User-Agent,Keep-Alive,Content-Type';
if ($request_method = OPTIONS)
return 204;
Credit: http://rustyrazorblade.com/post/2013/2013-10-31-cors-with-wildcard-domains-and-nginx/
New contributor
kintsukuroi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
did you read my original post/question? In my first phrase I mentioned that this link/source doesn't work for me.
– StandardNerd
yesterday
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f958965%2fnginx-enabling-cors-for-multiple-subdomains%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try moving the check for $http_origin into your location block.
You can see the same in the first example link you gave.
The variable is probably first filled when the location block is called.
moving the check for $http_origin into your location block doesn't change anything
– StandardNerd
Mar 28 at 16:05
add a comment |
Try moving the check for $http_origin into your location block.
You can see the same in the first example link you gave.
The variable is probably first filled when the location block is called.
moving the check for $http_origin into your location block doesn't change anything
– StandardNerd
Mar 28 at 16:05
add a comment |
Try moving the check for $http_origin into your location block.
You can see the same in the first example link you gave.
The variable is probably first filled when the location block is called.
Try moving the check for $http_origin into your location block.
You can see the same in the first example link you gave.
The variable is probably first filled when the location block is called.
answered Mar 26 at 8:58
unNamedunNamed
1216
1216
moving the check for $http_origin into your location block doesn't change anything
– StandardNerd
Mar 28 at 16:05
add a comment |
moving the check for $http_origin into your location block doesn't change anything
– StandardNerd
Mar 28 at 16:05
moving the check for $http_origin into your location block doesn't change anything
– StandardNerd
Mar 28 at 16:05
moving the check for $http_origin into your location block doesn't change anything
– StandardNerd
Mar 28 at 16:05
add a comment |
You can get around the limitation of only one subdomain by using this clever workaround that will allow all subdomains:
server
root /path/to/your/stuff;
index index.html index.htm;
set $cors "";
if ($http_origin ~* (.*.yoursweetdomain.com))
set $cors "true";
server_name yoursweetdomain.com;
location /
if ($cors = "true")
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'User-Agent,Keep-Alive,Content-Type';
if ($request_method = OPTIONS)
return 204;
Credit: http://rustyrazorblade.com/post/2013/2013-10-31-cors-with-wildcard-domains-and-nginx/
New contributor
kintsukuroi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
did you read my original post/question? In my first phrase I mentioned that this link/source doesn't work for me.
– StandardNerd
yesterday
add a comment |
You can get around the limitation of only one subdomain by using this clever workaround that will allow all subdomains:
server
root /path/to/your/stuff;
index index.html index.htm;
set $cors "";
if ($http_origin ~* (.*.yoursweetdomain.com))
set $cors "true";
server_name yoursweetdomain.com;
location /
if ($cors = "true")
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'User-Agent,Keep-Alive,Content-Type';
if ($request_method = OPTIONS)
return 204;
Credit: http://rustyrazorblade.com/post/2013/2013-10-31-cors-with-wildcard-domains-and-nginx/
New contributor
kintsukuroi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
did you read my original post/question? In my first phrase I mentioned that this link/source doesn't work for me.
– StandardNerd
yesterday
add a comment |
You can get around the limitation of only one subdomain by using this clever workaround that will allow all subdomains:
server
root /path/to/your/stuff;
index index.html index.htm;
set $cors "";
if ($http_origin ~* (.*.yoursweetdomain.com))
set $cors "true";
server_name yoursweetdomain.com;
location /
if ($cors = "true")
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'User-Agent,Keep-Alive,Content-Type';
if ($request_method = OPTIONS)
return 204;
Credit: http://rustyrazorblade.com/post/2013/2013-10-31-cors-with-wildcard-domains-and-nginx/
New contributor
kintsukuroi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
You can get around the limitation of only one subdomain by using this clever workaround that will allow all subdomains:
server
root /path/to/your/stuff;
index index.html index.htm;
set $cors "";
if ($http_origin ~* (.*.yoursweetdomain.com))
set $cors "true";
server_name yoursweetdomain.com;
location /
if ($cors = "true")
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'User-Agent,Keep-Alive,Content-Type';
if ($request_method = OPTIONS)
return 204;
Credit: http://rustyrazorblade.com/post/2013/2013-10-31-cors-with-wildcard-domains-and-nginx/
New contributor
kintsukuroi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
kintsukuroi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered yesterday
kintsukuroikintsukuroi
1
1
New contributor
kintsukuroi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
kintsukuroi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
kintsukuroi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
did you read my original post/question? In my first phrase I mentioned that this link/source doesn't work for me.
– StandardNerd
yesterday
add a comment |
did you read my original post/question? In my first phrase I mentioned that this link/source doesn't work for me.
– StandardNerd
yesterday
did you read my original post/question? In my first phrase I mentioned that this link/source doesn't work for me.
– StandardNerd
yesterday
did you read my original post/question? In my first phrase I mentioned that this link/source doesn't work for me.
– StandardNerd
yesterday
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f958965%2fnginx-enabling-cors-for-multiple-subdomains%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
could you show us how the config looks like when Ansible replaced the variables?
– unNamed
Mar 29 at 7:32