章工运维 章工运维
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)

章工运维

业精于勤,荒于嬉
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)
  • linux

  • windows

  • 中间件

  • 网络

  • 安全

  • 存储

  • 防火墙

  • 数据库

  • 系统

    • vmware

    • ftp

    • nexus

    • harbor

    • confluence&jira

    • loki

    • sonarqube

    • svn

    • other

    • openldap

    • influxdb

    • wordpress

    • kvm

    • argocd

    • jfrog

      • jfrog安装和破解
      • jfrog跨域问题处理
      • JFrog CLI 客户端的使用
    • nextcloud

    • RustDesk

    • mail

    • ghost

  • docker

  • other

  • 监控

  • 运维
  • 系统
  • jfrog
章工运维
2024-04-10

jfrog跨域问题处理

使用curl上传文件报错

[root@localhost ~]# curl -u admin:Tencent@123 -X PUT -T 1.0.1.tar.gz "http://192.168.153.102:18080/ui/local-aa"
Forbidden
1
2

查看服务日志

cb3c57e0f22a92a0.png

报错跨域问题

安装nginx解决跨域问题

nginx安装

yum install nginx -y
1

nginx启动

systemctl start nginx
1

添加jfrog配置

upstream artifactory {
 
server 127.0.0.1:28082;
 
}
 
upstream artifactory-direct {
 
server 127.0.0.1:28081;
 
}
 
server {
 
 
 
    listen 18080 ;
 
 
 
    server_name localhost;
 
    if ($http_x_forwarded_proto = '') {
 
        set $http_x_forwarded_proto  $scheme;
 
    }
 
    ## Application specific logs
 
    access_log /var/log/nginx/artifactory.jfrog.com-access.log;
 
    error_log /var/log/nginx/artifactory.jfrog.com-error.log;
 
    rewrite ^/$ /ui/ redirect;
 
    rewrite ^/ui$ /ui/ redirect;
 
    chunked_transfer_encoding on;
 
    client_max_body_size 0;
 
    location / {
 
        proxy_read_timeout  2400s;
 
        proxy_pass_header   Server;
 
        proxy_cookie_path   ~*^/.* /;
 
        proxy_buffer_size 128k;
 
        proxy_buffers 40 128k;
 
        proxy_busy_buffers_size 128k;
 
        proxy_pass          http://artifactory;
 
        proxy_set_header    X-JFrog-Override-Base-Url $http_x_forwarded_proto://$host:$server_port;
 
        proxy_set_header    X-Forwarded-Port  $server_port;
 
        proxy_set_header    X-Forwarded-Proto $http_x_forwarded_proto;
 
        proxy_set_header    Host              $http_host;
 
        proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
 
 
 
        location ~ ^/artifactory/ {
 
            proxy_pass    http://artifactory-direct;
 
        }
 
    }
 
 
}
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

加载配置

nginx -s reload

执行上传文件

curl -u admin:Tencent@123 -X PUT -T 1.0.1.tar.gz "http://192.168.153.102:18080/artifactory/local-aa/"
1

执行下载文件操作

curl -u admin:Tencent@123 -O "http://192.168.153.102:18080/artifactory/local-aa/conf_proxy.zip"
1
微信 支付宝
上次更新: 2024/04/10, 17:39:32

← jfrog安装和破解 JFrog CLI 客户端的使用→

最近更新
01
shell脚本模块集合
05-13
02
生活小技巧(认知版)
04-29
03
生活小技巧(防骗版)
04-29
更多文章>
Theme by Vdoing | Copyright © 2019-2025 | 点击查看十年之约 | 鄂ICP备2024072800号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式