通过nginx来做负载均衡,在跳转到对应的tomcat的时候,如果不配置j_spring_security_check的跳转,会出现404错误,正确的配置如下
location ~ .*(j_spring_security_check)$
{
proxy_pass http://tomcat_server;
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_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}