add CORS rules for allowing *.status.im domain calls
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
10d79744c7
commit
4773df2f1d
|
@ -5,3 +5,4 @@ faucet_account_pass: '{{lookup("passwordstore", "services/faucet/account-pass")}
|
|||
faucet_account_addr: '{{lookup("passwordstore", "services/faucet/account-addr")}}'
|
||||
faucet_account_json: '{{lookup("passwordstore", "services/faucet/account-json")}}'
|
||||
faucet_domain: 'faucet-{{ stage }}.status.im'
|
||||
faucet_cors_rule: '^https?://.*\.infura\.status.im'
|
||||
|
|
|
@ -11,6 +11,7 @@ faucet_account_json: '{"wallet":"json"}'
|
|||
faucet_account_pass: 'very-secret-password'
|
||||
faucet_network: 'rinkeby-faucet.example.org'
|
||||
faucet_domain: 'rinkeby'
|
||||
faucet_cors_rule: '.*'
|
||||
```
|
||||
|
||||
# API
|
||||
|
|
|
@ -4,6 +4,7 @@ faucet_account_addr: ~
|
|||
faucet_account_json: ~
|
||||
faucet_domain: ~
|
||||
faucet_network: ~
|
||||
faucet_cors_rule: ~
|
||||
|
||||
faucet_cont_tag: 'fixed'
|
||||
faucet_cont_image: 'statusteam/faucet:{{ faucet_cont_tag }}'
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
# This enables CORS for all status.im subdomains
|
||||
if ($http_origin ~* '{{ faucet_cors_rule | mandatory }}') {
|
||||
add_header 'Access-Control-Allow-Origin' "$http_origin";
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT';
|
||||
add_header 'Access-Control-Allow-Headers' 'User-Agent,Keep-Alive,Content-Type';
|
||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
||||
}
|
||||
if ($request_method = OPTIONS) {
|
||||
return 204;
|
||||
}
|
|
@ -14,5 +14,8 @@ server {
|
|||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:{{ faucet_http_port }}/;
|
||||
|
||||
{% include "cors-setup.conf.j2" %}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue