Error HTTP 405 when Session Starts using load balancing NGINX
<p>I implement Load Balancer using NGINX , but when I try to use some of the webapps developed in Java using Spring Security, when I try to login in one of the apps returns HTTP 405 - Request method 'POST' not supported.</p>

<p><a href="https://i.stack.imgur.com/DpXtZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DpXtZ.png" alt="enter image description here"></a></p>

<p>My NGINX conf file like this:</p>

<pre><code>upstream myapp {
        server 172.16.80.49:8095;      
        server 172.16.53.31:8091;
    }

server {
        listen 80;

        location / {
            proxy_set_header X-Forwarded-Host $host;
            proxy_set_header X-Forwarded-Server $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://172.16.80.49:8092;
        }
        location /docentes {
            proxy_set_header X-Forwarded-Host $host;
            proxy_set_header X-Forwarded-Server $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://myapp;
        }
        location /gerentes {
            proxy_set_header X-Forwarded-Host $host;
            proxy_set_header X-Forwarded-Server $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://myapp;
        }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}
</code></pre>

<p>how i can solve this, I suppose the app the problem would be csrf token</p>

<p><a href="https://i.stack.imgur.com/bMs39.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bMs39.png" alt="enter image description here"></a></p>