From 0283f0ed0b287a90f7269d0a362356036130760e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Fri, 20 Sep 2024 09:09:05 +0800 Subject: [PATCH] 'commit' --- ds-nginx/Dockerfile | 13 ------------- ds-nginx/nginx.conf | 29 ----------------------------- ds-nginx/static/index.html | 10 ---------- ds-nginx/文档.md | 21 --------------------- 4 files changed, 73 deletions(-) delete mode 100644 ds-nginx/Dockerfile delete mode 100644 ds-nginx/nginx.conf delete mode 100644 ds-nginx/static/index.html delete mode 100644 ds-nginx/文档.md diff --git a/ds-nginx/Dockerfile b/ds-nginx/Dockerfile deleted file mode 100644 index 1174fa3b..00000000 --- a/ds-nginx/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM openresty/openresty:1.21.4.1-0-alpine AS runner - -# ENV TZ这样的用法通常是用来设置时区环境变量,TZ代表Time Zone -ENV TZ=Asia/Shanghai - -# 将本地的Nginx配置文件复制到镜像中的指定路径 -COPY ./nginx.conf /usr/local/openresty/nginx/conf/nginx.conf - -# 将本地的静态资源文件复制到镜像中的指定路径 -COPY /static /usr/local/openresty/nginx/html - -# 暴露Nginx服务的端口 -EXPOSE 80 diff --git a/ds-nginx/nginx.conf b/ds-nginx/nginx.conf deleted file mode 100644 index 2de206ee..00000000 --- a/ds-nginx/nginx.conf +++ /dev/null @@ -1,29 +0,0 @@ -#user nobody; -worker_processes 1; - -events { - worker_connections 1024; -} - -http { - include mime.types; - default_type application/octet-stream; - - sendfile on; - client_max_body_size 100M; # 允许上传的最大文件大小为100MB - keepalive_timeout 65; - - server { - listen 80; - server_name ds-exam; - - location / { - root html; - index index.html index.htm; - } - - location /base { - proxy_pass http://127.0.0.1:9001/base; - } - } -} diff --git a/ds-nginx/static/index.html b/ds-nginx/static/index.html deleted file mode 100644 index b19e331c..00000000 --- a/ds-nginx/static/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - dsExam - - - Welcome to dsExam. - - \ No newline at end of file diff --git a/ds-nginx/文档.md b/ds-nginx/文档.md deleted file mode 100644 index 5e8f9fc3..00000000 --- a/ds-nginx/文档.md +++ /dev/null @@ -1,21 +0,0 @@ -### 思路 -以OpenResty做为网关,不使用JAVA系的方法构建网关 -原因: -1、OpenResty更快,性能更好 -2、OpenResty更灵活,更熟悉 -3、网关主要有两个职能是我关心的,一个是路由,另一个是鉴权, -路由无疑Nginx是无敌的,而鉴权我不想依赖于OpenResty,而且使用JAVA来让每个微服务模块 -来自行实现,各回各家,各找各妈,不把鉴权任务交给网关。 - -### 下载地址 -https://openresty.org/cn/download.html - -### Docker 镜像 -https://hub.docker.com/r/openresty/openresty - -```shell -docker run -p 80:80 -d openresty/openresty:1.21.4.1-0-alpine -``` -我采用的镜像是1.21.4.1-0-alpine,这个版本的底包较小,适合在容器中使用。 -需要使用Dockerfile来创建我的网关镜像,采用配置好的nginx.conf拷贝进镜像中, -并修改nginx.conf,使其符合我的需求。 \ No newline at end of file