From b73e9078bbe53e185ba0def94587a855972694d0 Mon Sep 17 00:00:00 2001 From: liberhe <411497616@qq.com> Date: Thu, 9 Nov 2023 18:58:22 +0800 Subject: [PATCH] add nginx --- docker-compose.yaml | 12 +++++++++- nginx.conf | 24 +++++++++++++++++++ .../dl/officialsite/team/TeamController.java | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 nginx.conf diff --git a/docker-compose.yaml b/docker-compose.yaml index 86adfcad..91be934e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,4 +18,14 @@ services: - "8081:8080" - "4001:4001" volumes: - - ./data/ipfs:/data/ipfs \ No newline at end of file + - ./data/ipfs:/data/ipfs + nginx: + container_name: mynginx + image: nginx:latest + ports: + - '80:80' + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf +# - ./conf.d:/etc/nginx/conf.d +# - ./logs:/var/log/nginx + restart: always diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 00000000..c30a7432 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,24 @@ + +events { + worker_connections 4096; ## Default: 1024 +} +http { + server { + listen 80; + listen [::]:80; + server_name ipfs.dapplearning.org; + location / { + proxy_pass http://localhost:8081; + proxy_read_timeout 60; + proxy_connect_timeout 60; + proxy_redirect off; + + # Allow the use of websockets + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } + } + } \ No newline at end of file diff --git a/src/main/java/com/dl/officialsite/team/TeamController.java b/src/main/java/com/dl/officialsite/team/TeamController.java index 4d22a9b1..ae8f5349 100644 --- a/src/main/java/com/dl/officialsite/team/TeamController.java +++ b/src/main/java/com/dl/officialsite/team/TeamController.java @@ -36,7 +36,7 @@ public class TeamController { * 新增团队 */ @PutMapping - BaseResponse add(@RequestBody TeamVO team, @RequestParam String address) { + BaseResponse create(@RequestBody TeamVO team, @RequestParam String address) { teamService.add(team); return BaseResponse.successWithData(team); }