mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 05:40:11 +01:00
Merge pull request #624 from gocsaf/add-acao-header
feat: add access-control-allow-origin header
This commit is contained in:
commit
e916f19ee4
3 changed files with 9 additions and 1 deletions
|
|
@ -78,6 +78,9 @@ server {
|
|||
|
||||
# directory listings
|
||||
autoindex on;
|
||||
|
||||
# allow others web applications to get the static information
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
}
|
||||
|
||||
# enable CGI
|
||||
|
|
@ -155,7 +158,7 @@ Again replacing `{clientCert.crt}` and `{clientKey.pem}` accordingly.
|
|||
|
||||
|
||||
To let nginx resolves the DNS record `csaf.data.security.domain.tld` to fulfill the [Requirement 10](https://docs.oasis-open.org/csaf/csaf/v2.0/cs01/csaf-v2.0-cs01.html#7110-requirement-10-dns-path) configure a new server block (virtual host) in a separated file under `/etc/nginx/available-sites/{DNSNAME}` like following:
|
||||
<!-- MARKDOWN-AUTO-DOCS:START (CODE:src=../docs/scripts/DNSConfigForItest.sh&lines=18-35) -->
|
||||
<!-- MARKDOWN-AUTO-DOCS:START (CODE:src=../docs/scripts/DNSConfigForItest.sh&lines=18-37) -->
|
||||
<!-- The below code snippet is automatically added from ../docs/scripts/DNSConfigForItest.sh -->
|
||||
```sh
|
||||
server {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ echo "
|
|||
|
||||
location = / {
|
||||
try_files /.well-known/csaf/provider-metadata.json =404;
|
||||
# allow others web applications to get the static information
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/dns-domain_access.log;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,9 @@ echo "
|
|||
|
||||
# directory listings
|
||||
autoindex on;
|
||||
|
||||
# allow others web applications to get the static information
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
" > locationConfig.txt
|
||||
sudo sed -i "/^\s*location \/ {/r locationConfig.txt" $NGINX_CONFIG_PATH # Insert config inside location{}
|
||||
./DNSConfigForItest.sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue