关于nginx: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;
    }
  }

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理