因为放在开发板上面,暴露在外网,我需要用Nginx反代Gogs, 但是因为开发板性能不太强,Nginx经常超时。
我用的master分支的代码,gogs 0.6.7.0829 Beta
我现在的配置是
server {
listen 443 ssl spdy;
include /etc/nginx/ssl.conf;
server_name _;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_redirect off;
keepalive_timeout 60;
sendfile on;
send_timeout 600s;
location /git/ {
client_body_buffer_size 32K;
client_max_body_size 300M;
proxy_send_timeout 86400s;
proxy_read_timeout 86400s;
proxy_connect_timeout 86400s;
proxy_pass http://gogs/;
}
}
可用看见 超时时间得设置非常长 而 client_max_body_size 的话,和postBuffer 的设置有关;
另外
我想镜像github上的源时超时了
2015/09/01 16:51:55 [1;31m[...routers/repo/repo.go:91 handleCreateError()] [E] MigratePost: git clone --mirror: Process execution timeout[0m
[Macaron] Completed /repo/migrate 500 Internal Server Error in 43m43.314713378s
而在我自己提交代码的时候有一堆的 401 不知道正不正常
[Macaron] Started GET /goagent/goagent.git/info/refs?service=git-upload-pack for 58.210.145.74
[Macaron] Completed /goagent/goagent.git/info/refs?service=git-upload-pack 401 Unauthorized in 77.58497ms
[Macaron] Started GET /goagent/goagent.git/info/refs?service=git-upload-pack for 58.210.145.74
[Macaron] Completed /goagent/goagent.git/info/refs?service=git-upload-pack 401 Unauthorized in 21.30125ms
[Macaron] Started GET /goagent/goagent.git/info/refs?service=git-upload-pack for 58.210.145.74
[Macaron] Completed /goagent/goagent.git/info/refs?service=git-upload-pack 200 OK in 1.982112301s
还有
不知道是不是放在二级目录下面的原因,自己镜像自己的源时,似乎没法获取Username
[Macaron] Started POST /repo/migrate for 192.168.8.1
2015/09/01 17:00:11 [1;36m[T] action.NewRepoAction: goagent/dd[0m
[Macaron] Started GET /niphor/memo.git/info/refs?service=git-upload-pack for 192.168.8.1
[Macaron] Completed /niphor/memo.git/info/refs?service=git-upload-pack 401 Unauthorized in 21.199794ms
2015/09/01 17:00:24 [1;31m[...routers/repo/repo.go:91 handleCreateError()] [E] MigratePost: git clone --mirror: Cloning into bare repository '/opt/gogs/data/gogs-repositories/goagent/dd.git'...
fatal: could not read Username for 'https://dev.4do.in': No such device or address
[0m
[Macaron] Completed /repo/migrate 500 Internal Server Error in 13.304859111s
最后:
https://github.com/gogits/gogs/blob/master/models/user.go#L183
gravatar 默认链接开头是//
所以,这么写所有gravatar 的头像都显示不出来了