云原生(四十八) | Nginx软件安装部署

文章目录

Nginx软件安装部署

一、Nginx软件部署步骤

二、安装与配置Nginx


Nginx软件安装部署

一、Nginx软件部署步骤

第一步:安装 Nginx 软件

第二步:把 Nginx 服务添加到开机启动项

第三步:配置 Nginx

第四步:启动Nginx

二、安装与配置Nginx

安装Nginx软件:

bash 复制代码
yum install nginx

把Nginx服务添加到开机启动项

bash 复制代码
systemctl enable nginx

配置Nginx

bash 复制代码
vim /etc/nginx/nginx.conf

server {
        listen       80;
        listen       [::]:80;
        server_name  localhost;
        root /web/wordpress;
        include /etc/nginx/default.d/*.conf;
        location / {
            index index.php index.htm index.html;
        }
        location ~ \.php$ {
            fastcgi_pass 127.0.0.1:9000;  # PHP-FPM 默认监听的地址和端口
            fastcgi_index index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include fastcgi_params;
        }
        ...
  }

配置完成后,启动Nginx

bash 复制代码
systemctl  start  nginx

  • 📢博客主页:https://lansonli.blog.csdn.net
  • 📢欢迎点赞 👍 收藏 ⭐留言 📝 如有错误敬请指正!
  • 📢本文由 Lansonli 原创,首发于 CSDN博客🙉
  • 📢停下休息的时候不要忘了别人还在奔跑,希望大家抓紧时间学习,全力奔赴更美好的生活✨
相关推荐
江畔何人初4 分钟前
Docker、containerd、CRI、shim 之间的关系
运维·docker·云原生·容器·kubernetes
2401_891655812 小时前
Git + 云原生:如何管理K8s配置版本?
git·云原生·kubernetes
困惑阿三3 小时前
客户消息及时反馈
nginx·node.js·飞书·企业微信
Volunteer Technology4 小时前
zookeeper基础应用与实战二
分布式·zookeeper·云原生
liurunlin8884 小时前
httpslocalhostindex 配置的nginx,一刷新就报404了
运维·nginx
BullSmall5 小时前
Nginx负载均衡会话保持配置指南
运维·nginx·负载均衡
不吃香菜kkk、5 小时前
夜莺n9e+监控K8s集群+自定义监控页面
运维·云原生·云计算
匀泪6 小时前
云原生(docker私有仓库)
云原生
匀泪6 小时前
云原生(docker网络)
docker·云原生·容器