瀏覽代碼

:bug: fix dashboard&nginx

Jeremy Zheng 3 年之前
父節點
當前提交
62853ad2e1
共有 2 個文件被更改,包括 23 次插入0 次删除
  1. 7 0
      scripts/spring/user/README.md
  2. 16 0
      scripts/spring/user/create.sh

+ 7 - 0
scripts/spring/user/README.md

@@ -0,0 +1,7 @@
+# User
+
+## dashboard@nginx
+
+```bash
+BUILD_PATH=/srv/http/$USER/dashboard yarn build
+```

+ 16 - 0
scripts/spring/user/create.sh

@@ -43,6 +43,12 @@ then
     chown $1:$1 /workspace/tmp/$1
 fi
 
+if [ ! -d $WORKSPACE/dashboard ]
+then
+    mkdir -p /workspace/dashboard/$1
+    chown $1:$1 /workspace/dashboard/$1
+fi
+
 if [ ! -f $WORKSPACE/nginx.conf ]
 then
     # https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
@@ -70,6 +76,16 @@ server {
     try_files \$uri \$uri/ /index.php?\$query_string;
   }
 
+  location /my/ {
+    alias $WORKSPACE/dashboard/;
+    try_files \$uri \$uri/ /my/index.html;
+    
+    location ~* \.(css|js|png|jpg|jpeg|gif|gz|svg|mp4|ogg|ogv|webm|htc|xml|woff)$ {
+      access_log off;
+      expires max;
+    }
+  }
+
   location = /favicon.ico { access_log off; log_not_found off; }
   location = /robots.txt  { access_log off; log_not_found off; }
   error_page 404 /index.php;