应用部署目录(修改域名地址,和目录)
mkdir -p /opt/lib/nginx/nginx-1.25.1/conf/ssl #认证文件
mkdir -p /opt/lib/nginx/nginx-1.25.1/conf/vhost #配置文件
配置文件
server {
listen 80;
server_name board.tosofts.com www.board.tosofts.com;
rewrite ^(.*)$ https://$host$1 permanent;
}
server {
listen 443 ssl;
#填写绑定证书的域名
server_name board.tosofts.com www.board.tosofts.com;
#网站主页路径。此路径仅供参考,具体请您按照实际目录操作。
root C:/0_project/ApplicationsRoot/apps/apis/board.tosofts.com;
#证书文件名称
ssl_certificate ssl/board.tosofts.com_bundle.crt;
#私钥文件名称
ssl_certificate_key ssl/board.tosofts.com.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