get tests passing in the browser
This commit is contained in:
4
packages/nostr/docker/cors-proxy/Dockerfile
Normal file
4
packages/nostr/docker/cors-proxy/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
# An nginx proxy which adds "Access-Control-Allow-Origin: *" to responses.
|
||||
|
||||
FROM nginx
|
||||
COPY config.sh /docker-entrypoint.d/
|
24
packages/nostr/docker/cors-proxy/config.sh
Executable file
24
packages/nostr/docker/cors-proxy/config.sh
Executable file
@ -0,0 +1,24 @@
|
||||
echo "\
|
||||
map \$http_upgrade \$connection_upgrade {\
|
||||
default upgrade;\
|
||||
'' close;\
|
||||
}\
|
||||
\
|
||||
proxy_read_timeout 600s;\
|
||||
\
|
||||
server {\
|
||||
listen 80;\
|
||||
server_name default;\
|
||||
\
|
||||
location / {\
|
||||
proxy_pass http://$TARGET;\
|
||||
proxy_http_version 1.1;\
|
||||
proxy_set_header Upgrade \$http_upgrade;\
|
||||
proxy_set_header Connection \$connection_upgrade;\
|
||||
# The NIP defines that the relay should return Access-Control-Allow-Origin: * here, so don't do it twice.\n\
|
||||
if (\$http_accept != 'application/nostr+json') {\
|
||||
add_header 'Access-Control-Allow-Origin' '*';\
|
||||
}\
|
||||
}\
|
||||
}" > /etc/nginx/conf.d/default.conf
|
||||
cat /etc/nginx/conf.d/default.conf
|
@ -1 +1,2 @@
|
||||
Dockerfile
|
||||
node_modules/
|
||||
|
@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y curl nodejs npm
|
||||
RUN npm i -g yarn
|
||||
|
||||
EXPOSE 8000
|
||||
EXPOSE 8080
|
||||
|
||||
COPY . .
|
||||
USER $APP_USER
|
||||
|
Reference in New Issue
Block a user