1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| # 安装编译工具 yum install gcc-c++ yum install -y pcre pcre-devel yum install -y zlib zlib-devel yum install -y openssl openssl-devel mkdir /usr/local/nginx # 解压安装 tar -zxvf /tmp/nginx-1.24.0.tar.gz -C /usr/local/nginx cd /usr/local/nginx/nginx-1.24.0/ ./configure --with-http_stub_status_module --with-http_ssl_module make && make install cd sbin ./nginx
# 修改端口映射,将其映射到我们的前端 index 文件 ../conf/nginx.conf
# server { # listen 80; # server_name localhost;
#
#
# location / { # root /你的目录/dist; # index index.html index.htm; # try_files $uri $uri/ /index.html; # } # 重启 nginx cd ../sbin/ ./nginx -s reload
|