Ubuntu22.04.2安装Nginx详细步骤!!

安装
更新软件包列表
apt update
安装nginx:
sudo apt install nginx -y
查看nginx服务是否启动
sudo systemctl status nginx
基础命令
查看版本
nginx -v
nginx version: nginx/1.18.0 (Ubuntu)

检查 配置文件
sudo nginx -t
正确返回结果:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

启动nginx
sudo nginx
停止服务
sudo nginx -s stop
重新加载配置文件
sudo nginx -s reload

//其他常用

docker inspect ly_crb

curl http://localhost:48080

posted on 2023-07-29 10:43  zyp_java_net  阅读(374)  评论(0编辑  收藏  举报

导航