首页 > 系统相关 >nginx 多个配置文件

nginx 多个配置文件

时间:2023-06-24 16:13:04浏览次数:43  
标签:index set 配置文件 多个 header yy nginx add proxy

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

相关文章

  • kafka学习之五_多个磁盘的性能验证
    kafka学习之五_多个磁盘的性能验证背景周末在家学习kafka上午验证了grafana+kafka_exporter的监控下午想着验证一把性能相关.kafka学习之三里面,有成套的脚本.我这边想起来之前还有一个机器,是四个单盘HDD,我可以直接进行使用和验证.测试思路计划创建四个partitio......
  • C# 将多个图片合成一个PDF
    一开始根据大部分网上的方式使用iTextSharp组件合成PDF,在初始化pdfdocument对象时,提示“未将对象引用设置为对象的实例”。iTextSharp.text.pdf.PdfWriter.GetInstance(document,newFileStream(@"D:\1.pdf",FileMode.Create,FileAccess.ReadWrite));不知道是否跟iTextShar......
  • WordPress开启Nginx FastCGI Cache缓存
    本文转载自:WordPress开启NginxFastCGICache缓存更多内容请访问钻芒博客:https://www.zuanmang.netWordPress速度优化始终是一个没有尽头的课题,最近逛几个技术大佬的站点发现都用了Nginx缓存,遂搜集资料展开部署。教程分享如下Ps.由于钻芒博客是通过Nginx反响代理到本地内网访问......
  • WordPress开启Nginx Redis Cache缓存 解决FastCGI Cache内网穿透兼容问题
    本文转载自:WordPress开启NginxRedisCache缓存解决FastCGICache内网穿透兼容问题更多内容请访问钻芒博客:https://www.zuanmang.net上回说到,Wordpress配合NginxFastCGICache缓存可以极大提升速度体验,但钻芒博客由于是通过Nginx反向代理所以使用起来纯在一定兼容问题,比如缓......
  • WPF-配置文件保存和读取
    方法一:属性-设置1,在项目工程名称上》右键属性》设置 2,设置和保存(保存按钮对应的代码)privatevoidBtn_save_Click(objectsender,RoutedEventArgse){intquantity=0;int.TryParse(txt_ToolQuantity.Text.Trim(),outquanti......
  • Nginx热升级
    Nginx热升级指服务不中断情况下用新的Nginx二进制文件替换老的Nginx二进制文件。1.备份和替换Nginx二进制文件gitclonehttps://github.com/nginx/nginx.gitcdnginxgitcheckoutrelease-1.22.0./auto/configure&&make&&makeinstall&&/usr/local/nginx/sbin/nginx......
  • 编译安装及更新 Nginx 服务
    目录一、编译安装Nginx1.下载Nginx源码包2.解压Nginx源码包3.安装编译安装依赖包4.创建运行用户与组5.设置安装的路径及模块6.编译与安装7.优化Nginx的命令8.检查Nginx配置文件是否配置正确二、Nginx版本升级1.安装新版本Nginx依赖包2.设置安装路径及模块3.......
  • Nginx上的HTTPS的配置
    Ngnix上配置HTTPS不算特别复杂,下面记录一下整体过程。生成自签名的SSL证书通过下面命令生成一系列文件,最终只需要server.key和server.crt两个就可以了opensslgenrsa-des3-outserver_temp.key2048opensslreq-new-keyserver_temp.key-outserver.csr-configopenssl.......
  • 让您的Nginx支持Http 3.0 协议
    Http3.0其实从最开设到正式的使用,已经过去了不少时间了,这块也是关系到我们现在数据安全一块很重要的发展,后续我们应该不在会有明文加密的协议的存在了吧,只是在加密的基础上,不断的升级现在的加密方法与技术升级,从而更高的保障我们的数据传输的高效与安全。并且我们也会在这路上......
  • nginx-1.22.1的rpm包,乱打。
    环境准备主机名WanIPLanIP应用角色web0110.0.0.7172.16.1.7fpm打包工具web0210.0.0.8172.16.1.8yumrepoyum仓库web0310.0.0.9172.16.1.9安装rpm包的客户端web01安装fpm打包工具#0.安装依赖[root@web01~]#yuminstall-yrpm-build#1.......