2021/6/6 nginx配置
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
添加CentOS 7 Nginx yum资源库, 然后我们开始安装,命令如下:
sudo yum install -y nginx
安装好之后,启动:sudo systemctl start nginx.service
Nginx配置信息:
网站文件存放默认目录 /usr/share/nginx/html
网站默认站点配置 /etc/nginx/conf.d/default.conf
自定义Nginx站点配置文件存放目录 /etc/nginx/conf.d/
Nginx全局配置 /etc/nginx/nginx.conf
Nginx启动 service nginx start
Nginx停止 service nginx stop
Nginx重启 service nginx restart
解决vue history直接跳转路由404问题 :
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}