I have the following:
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass unix:/var/run/php-fpm.sock;
...
if ($host = "www.domain.tld") {
add_header Access-Control-Allow-Origin "https://site.domain.tld";
}
what is the correct way to change the header so that if the path is contains /api the header then becomes:
add_header Access-Control-Allow-Origin "https://docs.domain.tld";
any advice is much appreciated