nginx 多个配置文件

1、

2、nginx.conf

worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
gzip on;
keepalive_timeout 5000;
include /eeeee/nginx-1.23.4/confs/*.conf; # 引用配置
}

3、web-html.conf

server {
listen 8085;
server_name localhost;
location /yy_admin {
alias E:/code/xxxxx_2/xxxxx2-admin/dist/;
try_files $uri $uri/ /yy_admin/index.html;
index index.html index.htm;
}
}
server {
listen 8086;
server_name localhost;
location / {
alias E:/code/xxxxx_2/xxxxx2-admin/dist/;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
}

3、jeecg-base.conf

# jeecg-base
server {
listen 80;
#listen 443 ssl;
#server_name zzz_.xxxxxjiankang.com;
#ssl_certificate 9312038_zzz_.xxxxxjiankang.com.pem;
#ssl_certificate_key 9312038_zzz_.xxxxxjiankang.com.key;
#ssl_protocols TLSv1.1 TLSv1.2;
#ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
#ssl_prefer_server_ciphers on;
#ssl_session_cache shared:SSL:10m;
#ssl_session_timeout 10m;
sendfile on;
client_max_body_size 5000m;
client_body_buffer_size 1000m;
keepalive_timeout 600;
send_timeout 600;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
index index.php index.html index.htm default.php default.htm default.html;
#error_page 405 =200 http://$host$request_uri;
#add_header 'Access-Control-Allow-Origin' '*';
#add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
#add_header 'Access-Control-Allow-Credentials' 'true';
#add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,X-Data-Type,X-Requested-With,X-Data-Type,X-Auth-Token,token';
#add_header Set-Cookie "/; Path=/; Secure; HttpOnly";
#if ( $request_method = 'OPTIONS' ) {
# return 200;
#}
# 首页开始
location = / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8087/yy_client/;
}
# 前端代理开始
location /yy_client/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8087/yy_client/;
}
location /yy_doctor {
alias /data/yy_new/yy_doctor/;
try_files $uri $uri/ /yy_doctor/index.html;
index index.html;
}
location /yy_admin {
alias /data/yy_new/yy_admin/;
try_files $uri $uri/ /yy_admin/index.html;
index index.html;
}
# 接口代理开始
location /mgt/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:10011/jeecg-mgt/;
}
location /rest/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:10012/jeecg-rest/;
}
location /zhongyi/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:10013/jeecg-zhongyi/;
}
location /mgt_stat/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:10014/jeecg-mgt-stat/;
}
location /api-weixin/ {
proxy_pass https://api.weixin.qq.com/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
}
}
posted @   一只桔子2233  阅读(406)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· .NET Core 中如何实现缓存的预热?
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
历史上的今天:
2020-06-24 启动mysql报错mysqld_safe error: log-error set to '/var/log/mariadb/mariadb.log'
2020-06-24 【Utils__JsonMapper】jackson工具类
2020-06-24 【Spring__ehcache 】ehcache简单使用
2020-06-24 【Spring__ApplicationContext】SpringContextHolder
2019-06-24 css 属性选择器
点击右上角即可分享
微信分享提示