项目部署跟普通项目无异,上传代码、建数据库、修改数据连接、关闭调试模式,然后到项目目录启动服务,更多细节参考webman官方
下面是nginx配置示例
查看代码
sh
# 把所有superadminx_preview改为自己的项目名称
upstream superadminx_preview {
# 端口可修改为自己的,后端服务也要修改端口
server 127.0.0.1:8888;
keepalive 10240;
}
server {
# 域名改为自己的
server_name preview.superadminx.com;
listen 80;
listen 443 ssl http2;
access_log off;
# 项目目录改为自己的
root /home/wwwroot/preview.superadminx.com/public;
#CERT-APPLY-CHECK--START
# 用于SSL证书申请时的文件验证相关配置 -- 请勿删除
include /www/server/panel/vhost/nginx/well-known/preview.superadminx.com.conf;
#CERT-APPLY-CHECK--END
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
ssl_certificate /www/server/panel/vhost/cert/preview.superadminx.com/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/preview.superadminx.com/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=31536000";
error_page 497 https://$host$request_uri;
#SSL-END
location ^~ / {
error_page 405 = @superadminx_preview;
try_files /${uri}/index.html /${uri} @superadminx_preview;
}
location @superadminx_preview {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Connection "";
if (!-f $request_filename){
proxy_pass http://superadminx_preview;
}
proxy_read_timeout 600s;
}
}