编程技术分享平台

网站首页 > 技术教程 正文

Nginx部署(nginx部署前端vue)

xnh888 2024-09-26 00:07:47 技术教程 18 ℃ 0 评论

一、准备工作

安装nginx前先安装 pcre pcre-devle openssl openssl-devel



二、安装nginx

./configure --user=nginx --group=nginx --prefix=/usr/local/nginx1.18 --with-http_stub_status_module --with-http_ssl_module


Make

Make install


三、检查启动

/usr/local/nginx/Sbin/Nginx -t 检查语法

/usr/local/nginx/Sbin/Nginx 启动nginx


sudo fuser -n tcp 80 –k 解除80端口占用


四、配置

根目录 root

站点目录 html

/usr/local/nginx/conf/fastcgi.conf 动态配置文件

/usr/local/nginx/conf/nginx.conf 静态配置文件




配置nginx.conf

每个server 一个站点

Server{

Listen 80;

Server_name localhost; 域名

Location / {

Root html ;

Index index.html index.html; 首页文件

}

Error_page 500 502 503 504 /50x.html;遇到500 等错误,跳的50x.html

Location = /50x.html {

Root html;

}

}

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表