ssh
alias hwdev="ssh -i ~/.ssh/id_rsa_huwei root@ip "
rsync
- systemctl enable rsyncd
- systemctl start rsyncd
rsync -avr -e "ssh -i ~/.ssh/id_rsa_huwei" * root@ip:/root/apps/api/ --exclude=bin --exclude=xx
nginx proxy_pass
user root;
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
#过期30天,静态文件不怎么更新,过期可以设大一点,
#如果频繁更新,则可以设置得小一点。
expires 30d;
}
location /api_aigc/ {
proxy_pass http://127.0.0.1:8000;#go 服务器可以指定到其他的机器上,这里设定本机服务器
#Proxy Settings
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
- systemctl start nginx
- systemctl status nginx
restart.sh
echo "restart "
ps aux | grep api | grep -v grep | awk '{ print $2;}' | xargs kill -9
go build -o api cmd/main/main.go
nohup /root/apps/api/api & >/dev/null
ps aux | grep api
echo "done"
tailf /data/go/logs/apitexttoimage.log







网友评论