From f98f52a118672517c9a79b985a92625cae75f62f Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Fri, 16 Aug 2024 13:53:25 +0800 Subject: [PATCH] backup ng --- config/nginx.conf.0722 | 107 +++++++++++++++++++++++++++++++++++++++++ config/nginx.conf.0816 | 107 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 214 insertions(+) create mode 100644 config/nginx.conf.0722 create mode 100644 config/nginx.conf.0816 diff --git a/config/nginx.conf.0722 b/config/nginx.conf.0722 new file mode 100644 index 0000000..a690c6e --- /dev/null +++ b/config/nginx.conf.0722 @@ -0,0 +1,107 @@ + +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + +http { +include mime.types; +default_type application/octet-stream; +server_tokens off; + +log_format main '$remote_addr - $remote_user [$time_local] "$request" ' +'$status $body_bytes_sent "$http_referer" ' +'"$http_user_agent" "$http_x_forwarded_for"'; + +#access_log logs/access.log main; +sendfile on; +#tcp_nopush on; + +#keepalive_timeout 0; +keepalive_timeout 65; +client_max_body_size 100M; +client_body_buffer_size 100M; +fastcgi_buffer_size 128k; +fastcgi_buffers 8 128k; +fastcgi_busy_buffers_size 128k; +fastcgi_temp_file_write_size 128k; +#gzip on; + + +upstream auth { +server 192.168.0.56:39200; +} + +upstream gateway { + server 192.168.0.56:39080; +} + +upstream base { + server 192.168.0.56:39301; +} + +upstream material { + server 192.168.0.56:39302; +} + +upstream system { + server 192.168.0.56:39201; +} + + + +server { +listen 80; +server_name localhost; +charset utf-8; + +location / { + # 网站根目录,此处使用容器内的路径 + root /usr/share/nginx/html/; + # 默认首页 + index index.html; + # 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html + try_files $uri $uri/ /index.html; + } + + location /auth/ { + proxy_pass http://auth/; + } + + location /code/ { + proxy_pass http://gateway; + } + + location /base/ { + proxy_pass http://base/; + } + +location /material/ { + proxy_pass http://material/; + } + +location /system/ { + proxy_pass http://system/; + } + +location /dev-api/ { + rewrite ^/dev-api/(.*)$ /$1 break; #必须的写这个,使用nginx的rewrite对uri进行重写 下面这行也要改为api + proxy_pass http://192.168.0.56:39080/; #跨域转发路由地址 + 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; + } + + +} + + +} + diff --git a/config/nginx.conf.0816 b/config/nginx.conf.0816 new file mode 100644 index 0000000..9fb98a0 --- /dev/null +++ b/config/nginx.conf.0816 @@ -0,0 +1,107 @@ + +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + +http { +include mime.types; +default_type application/octet-stream; +server_tokens off; + +log_format main '$remote_addr - $remote_user [$time_local] "$request" ' +'$status $body_bytes_sent "$http_referer" ' +'"$http_user_agent" "$http_x_forwarded_for"'; + +#access_log logs/access.log main; +sendfile on; +#tcp_nopush on; + +#keepalive_timeout 0; +keepalive_timeout 65; +client_max_body_size 100M; +client_body_buffer_size 100M; +fastcgi_buffer_size 128k; +fastcgi_buffers 8 128k; +fastcgi_busy_buffers_size 128k; +fastcgi_temp_file_write_size 128k; +#gzip on; + + +upstream auth { +server 192.168.0.56:39200; +} + +upstream gateway { + server 192.168.0.56:39080; +} + +upstream base { + server 192.168.0.56:39301; +} + +upstream material { + server 192.168.0.56:39302; +} + +upstream system { + server 192.168.0.56:39201; +} + + + +server { +listen 80; +server_name localhost; +charset utf-8; + +location / { + # 网站根目录,此处使用容器内的路径 + root /usr/share/nginx/html/; + # 默认首页 + index index.html; + # 尝试从磁盘找到请求的文件,如果不存在则跳转到 index.html + try_files $uri $uri/ /index.html; + } + + location /auth/ { + proxy_pass http://auth/; + } + + location /code/ { + proxy_pass http://gateway; + } + + location /base/ { + proxy_pass http://base/; + } + +location /material/ { + proxy_pass http://material/; + } + +location /system/ { + proxy_pass http://system/; + } + +location /dev-api/ { + #rewrite ^/dev-api/(.*)$ /$1 break; #必须的写这个,使用nginx的rewrite对uri进行重写 下面这行也要改为api + proxy_pass http://192.168.0.56:39080/; #跨域转发路由地址 + 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; + } + + +} + + +} +