应用部署目录(修改域名地址,和目录)
mkdir -p /opt/lib/nginx/nginx-1.25.1/conf/ssl #认证文件
mkdir -p /opt/lib/nginx/nginx-1.25.1/conf/vhost #配置文件
复制文件(避免编码问题)
cp /opt/lib/nginx/nginx-1.25.1/conf/nginx.conf /opt/lib/nginx/nginx-1.25.1/conf/vhost/bi.sandieji.tech-443.conf
vim /opt/lib/nginx/nginx-1.25.1/conf/vhost/bi.sandieji.tech-443.conf
mkdir -p /opt/apps/webs/bi.sandieji.tech #前端部署路径
配置文件
server {
listen 80;
server_name bi.sandieji.tech www.bi.tosofts.com;
# rewrite ^(.*)$ https://$host$1 permanent;
#}
#server {
# listen 443 ssl;
#填写绑定证书的域名
# server_name bi.sandieji.tech www.bi.sandieji.tech;
#网站主页路径。此路径仅供参考,具体请您按照实际目录操作。
root /opt/apps/webs/bi.sandieji.tech;
#证书文件名称
# ssl_certificate ssl/bi.sandieji.tech_bundle.crt;
#私钥文件名称
# ssl_certificate_key ssl/bi.sandieji.tech.key;
# ssl_session_timeout 5m;
# ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_prefer_server_ciphers on;
#文件上传403错误大小限制
# client_max_body_size 10m;
# 阻止特定文件访问
location ~* /.bat {
deny all;
}
location /bi/api/v3/board/ {
proxy_pass http://localhost:9095/;
proxy_set_header Host $host;
proxy_set_header XfromAppId $http_XfromAppId;
proxy_set_header XownerId $http_XownerId;
proxy_set_header XsysId $http_XsysId;
proxy_set_header XuserId $http_XuserId;
proxy_set_header XverifyApi $http_XverifyApi;
proxy_set_header Authorization $http_Authorization;
proxy_set_header XfilterAreaCode $http_XfilterAreaCode;
proxy_set_header XuserFromFirstShareId $http_XuserFromFirstShareId;
proxy_set_header XuserFromSecondShareId $http_XuserFromSecondShareId;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /file/download/ {
proxy_pass http://localhost:9095/file/download/;
proxy_set_header Host $host;
proxy_set_header XfromAppId $http_XfromAppId;
proxy_set_header XownerId $http_XownerId;
proxy_set_header XsysId $http_XsysId;
proxy_set_header XuserId $http_XuserId;
proxy_set_header XverifyApi $http_XverifyApi;
proxy_set_header Authorization $http_Authorization;
proxy_set_header XfilterAreaCode $http_XfilterAreaCode;
proxy_set_header XuserFromFirstShareId $http_XuserFromFirstShareId;
proxy_set_header XuserFromSecondShareId $http_XuserFromSecondShareId;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location @router {
rewrite ^.*$ /index.html last;
}
}
文档更新时间: 2023-08-22 23:20 作者:admin