From 3c9e6e0a12cdc758a68ef5d0c9fefcc0d9664f84 Mon Sep 17 00:00:00 2001 From: Harry Garrood Date: Sat, 2 May 2020 17:50:59 +0100 Subject: [PATCH 1/2] Serve the output directory from compile.purescript.org --- deploy/nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy/nginx.conf b/deploy/nginx.conf index 90d74e49..34296f8a 100644 --- a/deploy/nginx.conf +++ b/deploy/nginx.conf @@ -75,4 +75,8 @@ server { location / { proxy_pass http://127.0.0.1:8081; } + + location /output { + alias /var/www/trypurescript/staging/.psci_modules/node_modules; + } } From f3ba2a716849e0d2c0bbd37bc7fd3ddc678e010e Mon Sep 17 00:00:00 2001 From: Harry Garrood Date: Sat, 2 May 2020 19:19:45 +0100 Subject: [PATCH 2/2] Only serve JS files --- deploy/nginx.conf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy/nginx.conf b/deploy/nginx.conf index 34296f8a..b2c1bdb2 100644 --- a/deploy/nginx.conf +++ b/deploy/nginx.conf @@ -76,7 +76,9 @@ server { proxy_pass http://127.0.0.1:8081; } - location /output { - alias /var/www/trypurescript/staging/.psci_modules/node_modules; + # Serve JS files from the output directory. We use a regular expression + # match to ensure that we only serve JS files. + location ~ ^/output/(.+\.js)$ { + alias /var/www/trypurescript/staging/.psci_modules/node_modules/$1; } }