From f970bb41c2267ef872c06a3239b048c2426b9f22 Mon Sep 17 00:00:00 2001 From: chenc <1458513@qq.com> Date: Sun, 4 Aug 2024 10:46:21 +0800 Subject: [PATCH] =?UTF-8?q?2024=E5=B9=B48=E6=9C=884=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 2 +- .gitignore | 1 + docker-compose.yaml.example | 3 ++- java_gateway/{ => jar}/captcha-SNAPSHOT.jar | Bin java_gateway/run-script.sh | 6 ++++++ openresty/config/conf/nginx.conf.example | 6 ++++-- openresty/config/vhost/default.conf.example | 6 +++--- openresty/config/vhost/logdate.conf | 4 ++++ 8 files changed, 21 insertions(+), 7 deletions(-) rename java_gateway/{ => jar}/captcha-SNAPSHOT.jar (100%) create mode 100644 java_gateway/run-script.sh create mode 100644 openresty/config/vhost/logdate.conf diff --git a/.env.example b/.env.example index afb9197..eeeedcc 100644 --- a/.env.example +++ b/.env.example @@ -8,7 +8,7 @@ ELK_VERSION=7.17.22 ELASTICSEARCH_HOST_HTTP_PORT=9200 ELK_ELASTIC_PASSWD=hello321 -JAVAGATEWAY_VERSION=1.0.1 +JAVAGATEWAY_VERSION=1.0.3 NODEJS_VERSION=18.18.2 OPENRESTY_VERSION=1.25.3.1 REDIS_VERSION=7.2.5 diff --git a/.gitignore b/.gitignore index ae5f0f2..bfbaf90 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ logs/* openresty/config/vhost/* !openresty/config/vhost/ssl !openresty/config/vhost/default.conf.example +!openresty/config/vhost/logdate.conf redis/data .env \ No newline at end of file diff --git a/docker-compose.yaml.example b/docker-compose.yaml.example index 0639f86..c445c04 100644 --- a/docker-compose.yaml.example +++ b/docker-compose.yaml.example @@ -33,7 +33,8 @@ services: container_name: java-gateway restart: always volumes: - - "./java_gateway:/app" + - "./java_gateway/jar:/app" + command: ["/app/java_gateway1.jar","/app/java_gateway2.jar"] extra_hosts: - "host.docker.internal:host-gateway" networks: diff --git a/java_gateway/captcha-SNAPSHOT.jar b/java_gateway/jar/captcha-SNAPSHOT.jar similarity index 100% rename from java_gateway/captcha-SNAPSHOT.jar rename to java_gateway/jar/captcha-SNAPSHOT.jar diff --git a/java_gateway/run-script.sh b/java_gateway/run-script.sh new file mode 100644 index 0000000..69fd703 --- /dev/null +++ b/java_gateway/run-script.sh @@ -0,0 +1,6 @@ +#!/bin/sh +JAR_FILES=${@:-"/app/captcha-1.0-SNAPSHOT.jar"} +for JAR_FILE in $JAR_FILES; do + java -jar "$JAR_FILE" & +done +wait diff --git a/openresty/config/conf/nginx.conf.example b/openresty/config/conf/nginx.conf.example index 65a426a..17d8524 100644 --- a/openresty/config/conf/nginx.conf.example +++ b/openresty/config/conf/nginx.conf.example @@ -68,6 +68,7 @@ lua_shared_dict my_limit_req_store1 100m; server { listen 80; listen [::]:80; + http2 on; server_name _; access_log /data/wwwlogs/access_nginx.log combined; root /data/wwwroot/default; @@ -109,8 +110,9 @@ lua_shared_dict my_limit_req_store1 100m; } } server { - listen 443 ssl http2; - listen [::]:443 ssl http2; + listen 443 ssl; + listen [::]:443 ssl; + http2 on; ssl_certificate /usr/local/openresty/nginx/conf/vhost/ssl/cert.pem; ssl_certificate_key /usr/local/openresty/nginx/conf/vhost/ssl/private.key; ssl_protocols TLSv1.2 TLSv1.3; diff --git a/openresty/config/vhost/default.conf.example b/openresty/config/vhost/default.conf.example index 2f0b6c7..d90f978 100644 --- a/openresty/config/vhost/default.conf.example +++ b/openresty/config/vhost/default.conf.example @@ -1,9 +1,9 @@ server { listen 80; listen [::]:80; - - # listen 443 ssl http2; - # listen [::]:443 ssl http2; + http2 on; + # listen 443 ssl; + # listen [::]:443 ssl; # ssl_certificate /usr/local/openresty/nginx/conf/vhost/ssl/gateway.jsaix.cn.crt; # ssl_certificate_key /usr/local/openresty/nginx/conf/vhost/ssl/gateway.jsaix.cn.key; # ssl_protocols TLSv1.2 TLSv1.3; diff --git a/openresty/config/vhost/logdate.conf b/openresty/config/vhost/logdate.conf new file mode 100644 index 0000000..6a92f2f --- /dev/null +++ b/openresty/config/vhost/logdate.conf @@ -0,0 +1,4 @@ +map $time_iso8601 $logdate { + default 'date-not-found'; + '~^(?\d{4}-\d{2}-\d{2})' $ymd; +}