Skip to content

Commit 2cfa502

Browse files
committed
更新nginx配置
1 parent 358f90c commit 2cfa502

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

configuration.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
},
2828
"go": {
2929
"Debug" : true, /*是否是debug模式*/
30-
"UploadImgDir" : "/Users/liushen/dev/uploads/img", /*图片上传的目录*/
31-
"ImgPath" : "/img", /*上传后的图片请求地址前缀*/
30+
"UploadImgDir" : "/Users/liushen/dev/upload/img", /*图片上传的目录*/
31+
"ImgPath" : "/upload/img", /*上传后的图片请求地址前缀*/
3232
"Port" : 8012, /*go监听的端口*/
3333
"SessionID" : "iris.sid", /*后台设置的session id*/
3434
"MaxOrder" : 10000, /*最大的排序号*/

configuration.prod.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
},
2828
"go": {
2929
"Debug" : true, /*是否是debug模式*/
30-
"UploadImgDir" : "/Users/liushen/dev/uploads/img", /*图片上传的目录*/
31-
"ImgPath" : "/img", /*上传后的图片请求地址前缀*/
30+
"UploadImgDir" : "/data/web/up/upload/img", /*图片上传的目录*/
31+
"ImgPath" : "/upload/img", /*上传后的图片请求地址前缀*/
3232
"Port" : 8012, /*go监听的端口*/
3333
"SessionID" : "iris.sid", /*后台设置的session id*/
3434
"MaxOrder" : 10000, /*最大的排序号*/

nginx/www.shen100.com.conf

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ server {
3333
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
3434
}
3535

36-
location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css|eot|ttf|svg|woff|apk|jar|zip)$
36+
location /upload {
37+
root /data/web/up;
38+
expires 365d;
39+
}
40+
41+
location ~ ^(?!\/upload\/).+\.(gif|jpg|jpeg|bmp|png|swf|ico|txt|js|css|eot|ttf|svg|woff|apk|jar|zip)$
3742
{
3843
root /data/web/static;
3944
expires 365d;

0 commit comments

Comments
 (0)