自学内容网 自学内容网

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

文章目录

Nginx软件安装部署

一、Nginx软件部署步骤

二、安装与配置Nginx


Nginx软件安装部署

一、Nginx软件部署步骤

第一步:安装 Nginx 软件

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

第三步:配置 Nginx

第四步:启动Nginx

二、安装与配置Nginx

安装Nginx软件:

yum install nginx

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

systemctl enable nginx

配置Nginx

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

systemctl  start  nginx

  • 📢博客主页:https://lansonli.blog.csdn.net
  • 📢欢迎点赞 👍 收藏 ⭐留言 📝 如有错误敬请指正!
  • 📢本文由 Lansonli 原创,首发于 CSDN博客🙉
  • 📢停下休息的时候不要忘了别人还在奔跑,希望大家抓紧时间学习,全力奔赴更美好的生活✨ 

原文地址:https://blog.csdn.net/xiaoweite1/article/details/142716318

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!