nexus

nexus 是一个包仓库管理工具. 可以存储 java, csharp, docker 等等包.

要点:

  • 免费易用
  • 用户量大
  • 主流支持

docker 启动

1
docker run -d --restart=always -p 8081:8081 --name nexus -v /data/nexus:/nexus-data sonatype/nexus3

nginx 配置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
server {
    listen 80;
    server_name nexus.kentxxq.com;
    return 301 https://$server_name$request_uri;
    include /usr/local/nginx/conf/options/normal.conf;
    access_log /usr/local/nginx/conf/hosts/logs/nexus.kentxxq.com k-json;
}

server {
    listen 443 ssl;
    server_name nexus.kentxxq.com;

    include /usr/local/nginx/conf/options/ssl_kentxxq.conf;
    access_log /usr/local/nginx/conf/hosts/logs/nexus.kentxxq.com k-json;

    client_max_body_size 800M;

    location / {
        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 X-Forwarded-Proto "https";
        proxy_pass http://10.0.1.156:8081;
    }
}

可以通过设置一个代理, 这样就可以分流直接拉取国内无法访问的内容. HTTP and HTTPS Request and Proxy Settings