1.安装Nginx
apt-get install nginx
y
2.Nginx配置
1.删除default:
#防止错误,先把default文件给删除了 cd /etc/nginx/sites-available/ rm default ls cd /etc/nginx/sites-enabled ls rm default ls
2.新建配置文件:
cd /etc/nginx/sites-available/ vim gg.conf
3.编辑内容:
i #进入编辑状态
内容:
server{ listen 80; server_name gg; charset utf-8; client_max_body_size 75M; location /static { alias /home/ubuntu/gg/static; } location /media { alias /home/ubuntu/gg/media; } location / { uwsgi_pass 127.0.0.1:8000; include /etc/nginx/uwsgi_params; } }
保存退出:
Esc键+输入:wq+回车 #保存退出