location / {
root /cygdrive/d/codes/airfactory/air-restful/src/main/webapp;
index index.html index.htm;
}
location /restful/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080/air-restful/restful/;
}
本文介绍了一个具体的Nginx配置案例,展示了如何设置Nginx的根目录和默认索引文件,以及如何配置代理来转发RESTful API请求到后端服务。通过这个配置,可以实现静态资源与动态API的有效分离。
7919

被折叠的 条评论
为什么被折叠?



