酆叔のBlog

  • 首页
  • 分享技术
  • 八卦黑料
  • 生活日常
  • 日记
酆叔のBlog
上辈子作恶多端,这辈子早起上班。
  1. 首页
  2. IT技术
  3. 正文

安装Nginx

2024年4月3日 817点热度 0人点赞 0条评论

首先更新系统
sudo yum update

我安装在local目录下
cd /usr/local

下载安装包
wget http://nginx.org/download/nginx-1.25.3.tar.gz

解压安装包并进入目录
tar -zxvf nginx-1.25.3.tar.gz && cd /usr/local/nginx-1.25.3

编译参数
./configure --prefix=/usr/local/nginx \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-pcre \
--with-http_realip_module

编译
make

编译安装
make install

配置文件
server {
listen 80;
server_name www.fsg2023.top;

location / {
root /home/www/wordpress;
index index.html index.htm index.php;
}
}

配置Https
 server {
 listen 443 ssl;
 server_name www.fsg2023.top;

 ssl_certificate /usr/local/nginx-1.25.3/conf/ssl/fsg2023.top_bundle.crt;
 ssl_certificate_key /usr/local/nginx-1.25.3/conf/ssl/fsg2023.top.key;

 ssl_protocols TLSv1.2 TLSv1.3;
 ssl_prefer_server_ciphers on;
 ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:ECE-RSC-AES26-GCM-SGH612:ECAHE-RBM-AEE856-GCM-SHA384;

 location / {
 root /home/www/wordpress;
 index index.html index.htm index.php;
 }

 location ~ \.php$ {
 root /home/www/wordpress;
 fastcgi_pass 127.0.0.1:9000;
 fastcgi_index index.php;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 include fastcgi_params;
 }
 }
标签: Nginx
最后更新:2024年4月11日

酆叔

上辈子作恶多端,这辈子早起上班。

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

最新 热点 随机
最新 热点 随机
2025/05/15 周四 晴 2025/05/12 周一 晴 2025/05/08 周四 多云 2025/05/07 周三 阵雨 2025/05/06 周二 阵雨 2025/04/30 周三 多云
2025/05/15 周四 晴 认识PHP(九)面对对象的五大基本基本原则 VPN\机场 2025/05/07 周三 阵雨 修改数据库中所有数据表id自增为一 认识PHP(八)面对对象的三大基本特征
腾讯云
又拍云
订阅
订阅

COPYRIGHT © 2024 酆叔のBlog. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备2023016219号