我需要正确配置nginx代理才能返回所有内容,无论地址为localhost:8000的其他服务是什么。 例子:
example.com -> localhost:8000
example.com/api/book -> localhost:8000/api/book
example.com/js/main.js -> localhost:8000/js/main.js
example.com/css/main.css -> localhost:8000/css/main.css
POST GET PUT DELETE无论如何。 是否可以不指定每个子路径和每个文件扩展名?
答案 0 :(得分:0)
You just need a simple config
location / {
proxy_pass http://localhost:8000;
}
This should pass the request as it is with same path, data and http method