0

I've got a problem with NGINX, serving a folder.

server {
    listen [::]:80;
    server_name xyz.xyz;

    location / {
        add_header 'Access-Control-Allow-Origin' '*';

        autoindex on;
        root  /directory/to/folder;
    }
}

When I make a GET request for an image - server doesn't apply response header. Why?

I expected add_header 'Access-Control-Allow-Origin' '*'; may resolve it, just as when I serve api. I've also tried making another server, proxing that, and adding header on this another server.

Richard Smith
  • 45,711
  • 6
  • 82
  • 81
Gustaff
  • 13
  • 2

0 Answers0