1,环境
1,mysql5.7+,最好5.7.28以上版本,如果需要升级mysql版本请参考文章:https://www.cnblogs.com/sx66/p/16894893.html
2,php8.0.2+ ,参考文章:https://blog.csdn.net/zhouqi1427/article/details/126062100
3,打开防火墙端口,14728,443,80
2,使用Docker部署
1 2 3 4 5
| docker run -d \ --name lsky \ -p 14728:80 \ -v /root/docker/lsky:/var/www/html \ dko0/lsky-pro:2.0.4
|
- –name 设置容器名字为 lsky
- -p 设置端口隐射,容器的80端口映射给本地的14728端口
- -v 设置存储映射,本地的/root/docker/lsky 映射给 /var/www/html
3,配置nginx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| server { listen 80; server_name zxz106.com www.zxz106.com; return 301 https://www.zxz106.com$request_uri; } server { listen 443 ssl; server_name xxx.com www.xxx.com; ssl_certificate /usr/local/nginx/conf/sm3/1_zxz106.com_bundle.crt; ssl_certificate_key /usr/local/nginx/conf/sm3/2_zxz106.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers SM2-WITH-SMS4-SM3:ECDH:AESGCM:HIGH:MEDIUM:!RC4:!DH:!MD5:!aNULL:!eNULL; ssl_prefer_server_ciphers on; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header Upgrade-Insecure-Requests 1; proxy_set_header X-Forwarded-Proto https; # 转发到本地14728端口 proxy_pass http://localhost:14728; proxy_read_timeout 600s; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
|
配置完成后,就可以使用 https://www.zxz106.com/ 访问了,此时图片url还是ip+端口号的方式
配置图片使用域名访问:
登录图床以后,切换到存储策略
点击编辑
再看图片地址,就变成https://zxz106.com/i/2023/10/12/6527c67d41cfe.png了