前端 History 路由及 API 反向代理的 Nginx 配置
码上世界 / Jul 16, 2020 / 0 min read / 467
    
    underscores_in_headers on; 

    location ~ ^/prod-api {
      rewrite ^/prod-api/(.*)$ /$1 break;
      proxy_pass http://*****.com;
    }

    location ^/file {
        proxy_pass  http://*****.com;
    }

    location ~ / {
        try_files $uri  $uri/  /index.html;   
    }
    
    #if (!-e $request_filename) {
    #    rewrite ^/(.*) /index.html last;
    # break;
    #}