💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
第一步:基于epel源,安装nginx服务 [git@node1 conf]$ sudo yum -y install nginx 第二步:配置nginx虚拟主机 通过https://www.sslforfree.com/ 网站上申请免费的证书(使用3个月) 1) [git@node1 ssl]$ sudo cat /etc/nginx/conf.d/gogs.conf server { listen 443 ssl http2 default_server; server_name git.91als.net; # ssl_certificate /data/gogs/ssl/certificate.crt; ssl_certificate_key /data/gogs/ssl/gogs.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 10m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; # # # Load configuration files for the default server block. location / { proxy_set_header X-Real-IP $remote_addr; proxy_pass https://git.91als.net:7083/; } } 2) [git@node1 ssl]$ cd [git@node1 ~]$ cd /data/gogs/custom/conf/ [git@node1 conf]$ pwd /data/gogs/custom/conf [git@node1 conf]$ vim app.ini [server] PROTOCOL = https DOMAIN = git.91als.net HTTP_PORT = 7083 ROOT_URL = https://git.91als.net:7083/ DISABLE_SSH = false SSH_PORT = 22 START_SSH_SERVER = false OFFLINE_MODE = false CERT_FILE = /data/gogs/ssl/certificate.crt KEY_FILE = /data/gogs/ssl/gogs.key 注意:不配置nginx反向代理也可以,直接通过https://git.91als.net:7083访问 3)客户端通过https拉取代码 注意:git版本不能使用1.7的,需要安装2.1以上的版本 [root@static ~]# git clone https://git.91als.net:7083/administrator/Pet_ios.git Cloning into 'Pet_ios'... Username for 'https://git.91als.net:7083': administrator Password for 'https://administrator@git.91als.net:7083': warning: You appear to have cloned an empty repository. Checking connectivity... done.