nginx部署前端项目笔记
文章目录
记录nginx部署前端项目所需配置
前端router history模式
server {
listen 443; # 监听本机所有ip上的 443 端口
server_name aax.xxx.com; # 域名地址
root /xxx/xxx/xxx;
# 新建日志文件
access_log /xxx/xxx/xxx/xxx/xxx/access.log main;
location / {
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /502.html;
location = /50x.html {
root html;
}
}nginx命令
启动 nginx 服务: ./nginx
关闭 nginx 服务:./nginx -stop
重启 nginx 服务:./nginx -s reload (用得最多)
查看 nginx 进程:ps -ef | grep nginx
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论