项目部署
使用指南项目部署小于 1 分钟约 148 字
相关信息
后台部署推荐 PM2 https://pm2.keymetrics.io/
Nginx 部署配置:
server {
listen 5005;
listen [::]:5005;
server_name localhost; # 没有域名可不写
location / {
root /opt/dist;
index index.html index.htm;
}
location /api/ {
proxy_pass http://xxx:5005; # 设置为本地启动地址
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 解决获取不到真实的用户 IP 地址
proxy_set_header X-Forwarded-Proto $scheme; # 解决获取不到真实的用户 IP 地址
}
location /hubs/ {
proxy_pass http://xxx:5005;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /upload/ {
alias /opt/adminnet/wwwroot/Upload/;
}
}