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;
}
}
标签:index,set,配置文件,多个,header,yy,nginx,add,proxy
From: https://www.cnblogs.com/kikyoqiang/p/17501232.html