-
springboot实现反向代理 出现的问题为post请求到最终的服务端时获取不到参数,初步测试没什么问题
@Bean
public FilterRegistrationBean registration(HiddenHttpMethodFilter filter) {
FilterRegistrationBean registration = new FilterRegistrationBean(filter);
registration.setEnabled(false);
return registration;
}
- 使用vue的代理
- ng实现代理
location /compManage {
charset utf-8;
add_header Access-Control-Allow-Origin *;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $clientip;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#测试
proxy_pass http://10.243.206.12/compManage;
#生产
#proxy_pass http://10.243.30.114/compManage;
}