diff --git a/configuration.json b/configuration.json index 2b490c33..cbf7eb87 100644 --- a/configuration.json +++ b/configuration.json @@ -27,8 +27,8 @@ }, "go": { "Debug" : true, /*是否是debug模式*/ - "UploadImgDir" : "/Users/liushen/dev/uploads/img", /*图片上传的目录*/ - "ImgPath" : "/img", /*上传后的图片请求地址前缀*/ + "UploadImgDir" : "/Users/liushen/dev/upload/img", /*图片上传的目录*/ + "ImgPath" : "/upload/img", /*上传后的图片请求地址前缀*/ "Port" : 8012, /*go监听的端口*/ "SessionID" : "iris.sid", /*后台设置的session id*/ "MaxOrder" : 10000, /*最大的排序号*/ diff --git a/configuration.prod.json b/configuration.prod.json index 829c0350..0979cff8 100644 --- a/configuration.prod.json +++ b/configuration.prod.json @@ -27,8 +27,8 @@ }, "go": { "Debug" : true, /*是否是debug模式*/ - "UploadImgDir" : "/Users/liushen/dev/uploads/img", /*图片上传的目录*/ - "ImgPath" : "/img", /*上传后的图片请求地址前缀*/ + "UploadImgDir" : "/data/web/up/upload/img", /*图片上传的目录*/ + "ImgPath" : "/upload/img", /*上传后的图片请求地址前缀*/ "Port" : 8012, /*go监听的端口*/ "SessionID" : "iris.sid", /*后台设置的session id*/ "MaxOrder" : 10000, /*最大的排序号*/ diff --git a/nginx/www.shen100.com.conf b/nginx/www.shen100.com.conf index 6d1f911d..2bacc3d7 100644 --- a/nginx/www.shen100.com.conf +++ b/nginx/www.shen100.com.conf @@ -33,7 +33,12 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } - location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css|eot|ttf|svg|woff|apk|jar|zip)$ + location /upload { + root /data/web/up; + expires 365d; + } + + location ~ ^(?!\/upload\/).+\.(gif|jpg|jpeg|bmp|png|swf|ico|txt|js|css|eot|ttf|svg|woff|apk|jar|zip)$ { root /data/web/static; expires 365d;