Skip to content

Instantly share code, notes, and snippets.

@lengarvey
Created September 25, 2012 01:14
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lengarvey/3779411 to your computer and use it in GitHub Desktop.
Save lengarvey/3779411 to your computer and use it in GitHub Desktop.
Access control allow origin header for nginx
location /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
> curl -I https://www.airtasker.com/assets/marker.png
HTTP/1.1 200 OK
Server: nginx/0.7.67
Date: Tue, 25 Sep 2012 01:13:25 GMT
Content-Type: image/png
Content-Length: 3996
Last-Modified: Mon, 16 Jul 2012 07:34:04 GMT
Connection: keep-alive
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000
Cache-Control: public
Access-Control-Allow-Origin: *
Accept-Ranges: bytes
@treacher
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment