I have a usecase where a files are grouped and each group can be served for a specific domain name in nginx server. I am not sure how can I acheive that. valid_referer
is something which is similar but that works on referer header not on original url. Is there anything similar to valid_referer
like valid_origin
?
with valid refererer my config looks like this. But would prefer to handle same via origin condition instead.
location /landing/jack/ {
valid_referers ~\.codejack\. ~\.jacktest\.;
if ($invalid_referer) {
return 403;
}
}
Edit: files are grouped via location. So each location can say to be linked to one or more origins.
location /landing/google/ {
valid_referers ~\.google\.;
if ($invalid_referer) {
return 403;
}
}
location /landing/stackoverflow/ {
valid_referers ~\.stackoverflow\.;
if ($invalid_referer) {
return 403;
}
}
All I need is conditional way where I use origin url instead of referer url.