云原生(四十八) | 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博客🙉
  • 📢停下休息的时候不要忘了别人还在奔跑,希望大家抓紧时间学习,全力奔赴更美好的生活✨
相关推荐
阿里云云原生16 小时前
阿里云获评 Agentic AI 开发平台领导者,函数计算 AgentRun 赢下关键分!
云原生
何中应1 天前
Nginx转发请求错误
前端·后端·nginx
阿里云云原生1 天前
MSE Nacos Prompt 管理:让 AI Agent 的核心配置真正可治理
微服务·云原生
阿里云云原生1 天前
当 AI Agent 接管手机:移动端如何进行观测
云原生·agent
阿里云云原生1 天前
AI 原生应用开源开发者沙龙·深圳站精彩回顾 & PPT下载
云原生
阿里云云原生1 天前
灵感启发:日产文章 100 篇,打造“实时热点洞察”引擎
云原生
~莫子2 天前
Haproxy七层负载详解+实验详细代码
云原生
阿里云云原生2 天前
OpenTelemetry + 云监控 2.0:打造你的云原生全栈可观测
云原生
芝士雪豹只抽瑞克五2 天前
Nginx 高性能Web服务器笔记
服务器·nginx