Add CORS for spack.packages.io

Add the HTTP header `Access-Control-Allow-Origin: *` for our NGINX
service that is serving static JSON content on
https://spack.packages.io .
This commit is contained in:
Axel Huebl 2019-09-07 23:31:14 -07:00 committed by Todd Gamblin
parent db1fb16840
commit 02931a82fd
2 changed files with 4 additions and 0 deletions

View file

@ -7,5 +7,6 @@ RUN /build/split.sh
FROM nginx:mainline-alpine
COPY --from=build-env --chown=nginx:nginx /build/packages /build/packages.json /usr/share/nginx/html/api/
COPY cors-header.conf /etc/nginx/conf.d/
CMD ["nginx", "-g", "daemon off;"]

View file

@ -0,0 +1,3 @@
# potentially add even more for preflight support
# https://enable-cors.org/server_nginx.html
add_header 'Access-Control-Allow-Origin' '*';