1
0
mirror of https://github.com/oceanprotocol/barge.git synced 2024-11-22 17:50:13 +01:00

Merge pull request #47 from oceanprotocol/secret-store-api-cors-proxy

secret store api cors proxy
This commit is contained in:
Javier Cortejoso 2018-11-23 09:52:49 +01:00 committed by GitHub
commit 08bbaea69f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 1 deletions

29
cors-proxy.conf Normal file
View File

@ -0,0 +1,29 @@
events {}
http {
upstream ss {
server secret-store:12001;
}
server {
listen 12001;
location ~ ^/ {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow_Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow_Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
proxy_pass http://ss;
proxy_redirect off;
proxy_set_header Origin "";
}
access_log off;
error_log off;
}
}

View File

@ -53,11 +53,24 @@ services:
- ./parity/secret_store/keys/:/parity_data/keys/ocean-network/
ports:
- 12000:12000
- 12001:12001
- 12001
networks:
backend:
ipv4_address: 172.15.0.13
secret-store-cors-proxy:
image: nginx:alpine
volumes:
- ./cors-proxy.conf:/etc/nginx/nginx.conf:ro
depends_on:
- secret-store
ports:
- 12001:12001
networks:
backend:
ipv4_address: 172.15.0.16
command: nginx -g 'daemon off;'
keeper-contracts:
image: oceanprotocol/keeper-contracts:${OCEAN_VERSION:-stable}
networks: