Cookie path with reverse proxy

Stefan Meier meier.stefan at gmail.com
Thu Mar 14 16:37:49 UTC 2019


I have three different applications running behind a NGINX reverse proxy.

They all have a login GUI, which uses the same authentication API.
Authentication is based on cookies.

My problem is now, that the path's of the cookies are set differently
depending on which GUI is used to login.

The authentication API, actually sets the cookie-path to /, but I assume it
is the NGINX proxy, which is overwriting that depending on the location to
/app or /admin.

Is there a way to set the path of the cookies to /, regardless which GUI is
used?

I appreciate any help.

This is how my configuration looks like:

http {
    server {
        listen       80;
        server_name  localhost;

        location = / {
            rewrite / /admin;
        }

        location /admin/ {
            proxy_pass  http://localhost:9001/;
        }

        location /app/ {
            proxy_pass http://localhost:3100/;
        }

        location / {
            proxy_pass  http://localhost:3000/;
        }
    }}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20190314/ec465d22/attachment.html>


More information about the nginx mailing list