Nginx配置
外观
环境
我现在的系统是Debian13,所以接下来会以 "apt" 作为包管理器工具
下载
首先下载nginx
输入apt install nginx -y
配置
安装好了,我们打开 "/etc/nginx" 文件夹
我个人建议注释掉当前目录下 "sites-enable/default"文件里面的全部内容,这样会比较干净
然后再建立名为 "service" 的文件
往里面写入
server {
listen: 80;
servername: _;
index index.html index.htm index.nginx-debian.html;
location \ {
}
}
接下来再运行systemctl restart nginx
如果不保险的话还可以执行两遍nginx
如果有问题的话,会显示出来的
最后,在你的浏览器输入你的服务器ip
看到了
Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com. Thank you for using nginx.
恭喜你!!!大功告成!!!
确认正确显示后就可以删掉"/var/www/html"里面的"index.nginx-debian.html"
自己写内容了