前几天在树莓派上安排好了php环境,又在阿里云服务器上安排好了mysql环境。(之所以没在树莓派上搞mysql是听说在树莓派上安装mysql对树莓派硬件有不良影响)这样一大波基于LNMP的开源服务就可以部署了。
之前一直使用h5ai+nginx+sftp作为简易的网盘分享程序,用了一年多,感觉自己用起来还可以,就是过于简易。
具体安装配置github上面都有,关键是数据库与nginx配置。
这里就先放一个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 30 31 32 33
| server { listen 443 ssl http2; listen [::]:443 ssl http2; ssl_certificate /home/pi/key/dog.pem;
ssl_certificate_key /home/pi/key/dog.key;
server_name pan.dogcraft.top ; root /media/pi/udisk/pan/; charset utf-8; client_max_body_size 4096m; location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } root /media/pi/udisk/pan/; index index.html index.php; } location /protected_files { internal; #此处为public/uploads目录的绝对路径 alias /media/pi/udisk/pan/public/uploads/; } location ~ \.php?.*$ { fastcgi_pass unix:/run/php/php7.3-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
}
|