标签:nload sep 路径 安装nginx tom nginx配置 amp lis automake
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
cd /usr/local
mkdir nginx
cd nginx
wget http://nginx.org/download/nginx-1.13.7.tar.gz
tar -xvf nginx-1.13.7.tar.gz
cd /usr/local/nginx/nginx-1.13.7 (当前下载的nginx的版本)
./configure
yum -y install gcc automake autoconf libtool make
make && make install
好了如果访问 当前IP有页面显示的话那么nginx就是安装成功了
Nginx的配置文件路径 /user/local/nginx/conf/nginx.conf
location / {
alias /home/wwwroot/default/dist/; #默认访问vue静态文件目录(dist路径)
index index.html; #默认访问文件
try_files $uri $uri/ /index.html; #目录不存在则执行index.html
}
如还是不懂的话就看下面吧!重要的地方标了两个 ** 就是配置读取vue项目静态文件路径(这个是全部Nginx配置文件)
server
{
listen 80 default_server reuseport;
include enable-php.conf;
** location / {
alias /home/wwwroot/default/dist/; #默认访问目录
index index.html; #默认访问文件
try_files $uri $uri/ /index.html; #目录不存在则执行index.html
}
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
标签:nload sep 路径 安装nginx tom nginx配置 amp lis automake
原文地址:https://www.cnblogs.com/bbdbolg/p/15047348.html