记录一下自己遇到的问题
1.检查页面显示404,找不到media、js、css文件。路径问题,找到本地存储这些文件的路径,在nginx配置文件中加入配置就行了。
注意:我的系统前端是streamlit实现的,这些文件在当前python环境的streamlit包中找到的。2.检查页面显示403,无权限访问
启动用户与Nginx工作用户不一致。
ps -aux | grep nginx查看nginx的master用户是root
去/etc/nginx路径下,查看nginx.cong文件中user是其他用户,不是root
把nginx.cong的user改为root:
sudo vi NLP.conf 向文件中写入配置、检查配置是否有效:使用指令 sudo nginx -t、重启Nginx:使用指令 sudo systemctl restart nginx