Kirin 2 months ago
parent
commit
90369000a5
3 changed files with 36 additions and 4 deletions
  1. 32 0
      .example.proxy.conf
  2. 3 3
      config/filesystem.php
  3. 1 1
      qiniu/services/upload/Upload.php

+ 32 - 0
.example.proxy.conf

@@ -0,0 +1,32 @@
+#PROXY-START/
+location  ~* \.(php|jsp|cgi|asp|aspx)$
+{
+    proxy_pass http://127.0.0.1:21919;
+    proxy_set_header Host $host;
+    proxy_set_header X-Real-IP $remote_addr;
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    proxy_set_header REMOTE-HOST $remote_addr;
+}
+location /
+{
+    if (!-e $request_filename) {
+         proxy_pass http://127.0.0.1:21919;
+    }
+    proxy_http_version 1.1;
+    proxy_read_timeout 360s;
+    proxy_redirect off;
+    proxy_set_header Upgrade $http_upgrade;
+    proxy_set_header Connection "upgrade";
+    proxy_set_header Host $host;
+    proxy_set_header X-Real-IP $remote_addr;
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    proxy_set_header REMOTE-HOST $remote_addr;
+
+    add_header X-Cache $upstream_cache_status;
+
+    #Set Nginx Cache
+
+       add_header Cache-Control no-cache;
+    expires 12h;
+}
+#PROXY-END/

+ 3 - 3
config/filesystem.php

@@ -2,7 +2,7 @@
 
 return [
     // 默认磁盘
-    'default' => env('filesystem.driver', 'local'),
+    'default' => env('filesystem.driver', 'public'),
     // 磁盘列表
     'disks'   => [
         'local'  => [
@@ -13,9 +13,9 @@ return [
             // 磁盘类型
             'type'       => 'local',
             // 磁盘路径
-            'root'       => app()->getRootPath() . 'public/storage',
+            'root'       => app()->getRootPath() . 'public/uploads',
             // 磁盘路径对应的外部URL路径
-            'url'        => '/storage',
+            'url'        => '/uploads',
             // 可见性
             'visibility' => 'public',
         ],

+ 1 - 1
qiniu/services/upload/Upload.php

@@ -27,7 +27,7 @@ class Upload extends BaseManager
      * 空间名
      * @var string
      */
-    protected $namespace = '\\crmeb\\services\\upload\\storage\\';
+    protected $namespace = '\\qiniu\\services\\upload\\storage\\';
 
     /**
      * 设置默认上传类型