NGINX, ssl, CORS, and caching of Access-Control-Allow-Origin value cross-site
I am trying to write an nginx config that will handle two sites on both http and https, it seems to work as long as a client never visits both sites, but if they do there are caching/cross-site issues. # Allow cross origin location ~* \.(eot|svg|ttf|woff|woff2|json)$ { if ($http_origin ~* (https?://(admin\.)?example\.com(:[0-9]+)?)) { add_header 'Access-Control-Allow-Origin' "$http_origin"; } } So if I load example.com, everything works, but then when I load admin.example.com I get issues like this (index):1 XMLHttpRequest cannot load http://origin.example.com/js/data-lib/currency.json . The