Windows 系统 nginx-1.16.1 手动配置反向代理和部署前端Web工程

nginx+tomcat 简单的前后端分离部署 和 反向代理配置

Windows 系统 nginx-1.16.1 手动配置反向代理和部署前端Web工程

静态web部署配置:    

1、将web工程文件夹拷贝到 Nginx 解压路径【nginx-1.16.1\html】下,示例中web工程文件夹名称为sweb。

2、添加 location节点 :

location /sweb/ {
            root   html;
            index  hello.html hello.htm; 
        }

Windows 系统 nginx-1.16.1 版本nginx  web应用 root 路径 无需在【html】后面加web工程文件夹名称,nginx 会自动添加上下文;否则访问静态html页面时会得到 【404 Not Found】响应。