Move CORS headers from nginx to ipfs

This commit is contained in:
Greg 2017-06-09 13:34:44 +02:00
parent e5f3121ee3
commit f96444d6f4
2 changed files with 11 additions and 4 deletions

View File

@ -21,4 +21,15 @@ ipfs_config "Gateway.Writable" do
value true
end
# Set up CORS headers
ipfs_config "API.HTTPHeaders.Access-Control-Allow-Credentials" do
value '["true"]'
end
ipfs_config "API.HTTPHeaders.Access-Control-Allow-Methods" do
value '["PUT", "GET", "POST"]'
end
ipfs_config "API.HTTPHeaders.Access-Control-Allow-Origin" do
value '["*"]'
end
include_recipe "kosmos-ipfs::letsencrypt"

View File

@ -31,10 +31,6 @@ server {
# Increase number of buffers. Default is 8
proxy_buffers 1024 8k;
proxy_http_version 1.1;
# CORS headers for Kredits
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT';
add_header 'Access-Control-Allow-Credentials' 'true';
location /api/v0/cat {
proxy_pass http://_ipfs/api/v0/cat;