From 43433d10e35c88810f63b2988ce95d52e2d0ec48 Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期六, 04 一月 2025 20:28:18 +0800 Subject: [PATCH] add ops script --- script/start-jh | 12 ++++++++++++ script/jinhua.conf | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 0 deletions(-) diff --git a/script/jinhua.conf b/script/jinhua.conf new file mode 100644 index 0000000..9952ad1 --- /dev/null +++ b/script/jinhua.conf @@ -0,0 +1,34 @@ +upstream apiserver_jh{ + ip_hash; + server 127.0.0.1:48080; +} + + +server { + listen 80; + server_name 10.0.2.193; + + error_page 404 404.html; + + location / { + root /usr/share/nginx/jinhua/dist-prod; + try_files $uri $uri/ /index.html; + index index.html index.htm; + } + + location /admin-api/ { + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Cookie $http_cookie; + proxy_pass http://apiserver_jh; + } + + #location /doc.html { + # proxy_pass http://api-backend/; + # index doc.html doc.htm; + #} +} + diff --git a/script/start-jh b/script/start-jh new file mode 100755 index 0000000..dcb479e --- /dev/null +++ b/script/start-jh @@ -0,0 +1,12 @@ +#!/bin/bash +pid=$(ps -ef | grep library-server.jar | grep -v grep | awk '{print $2}') +if [ -z "$pid" ]; then + echo "library-server process NOT EXIST" +else + echo "KILL library-server process ${pid}" + kill -9 $pid +fi + +nohup java -Dspring.profiles.active=dev -jar library-server.jar >/dev/null 2>&1 & + +ps aux | grep library-server.jar | grep -v grep -- Gitblit v1.9.3