|
I need to add a custom header to each response sent by nginx for my static-only application. With Apache I'd put the following in a .htaccess file: Header set Access-Control-Allow-Origin "*" How do I do it with nginx? |
|
Surely you can add those specific headers, but you may end up having missing parts on a RESTful API that uses 20X status codes. You can try to install a custom version of nginx on your application with HttpHeadersMoreModule. In my way to use CORS on the deploy environment I pointed my API application (Rails in this case) as a subdirectory of a static application ( |