How do I allow cross origin requests in only a specific folder or folders in Nginx?

In apache, I have an .htaccess file in the folder with the following content:

<FilesMatch "\.(json)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.