解决 静态页面 post 请求的问题

nginx :405 Method not allowed
error_page 405 =200 @405;
location @405 {
root /html;
proxy_method GET;
proxy_pass http://static_backend;
}

webpack devserver

devServe:{
setup: (app) => { //解决post没响应的问题
app.post(‘/goform/**’, function(req, res) {
res.redirect(req.originalUrl); //重定向到对应路径
});
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *