reverse proxy - http (80) to https (back-end) in Docker container

Joey Côté cotjoey at gmail.com
Mon May 27 17:51:06 UTC 2019


Hello all,

I am attempting to use nginx as a reverse proxy to funnel HTTP traffic to a
HTTPS back-end (both in a Docker container). I cannot enable HTTPS on my
front-end yet, so this would be a temporary solution to my issue.

Only one of my back-end application is giving me an issue right now, and
that issue seems to be characterized by the JSESSIOND cookie coming from
the back-end  being lost at the nginx level. If I test outside Docker with
SSL, I get a JSESSIONID cookie in my request back.

My two URLs are [example]:
http://myurl.example.com/AppA
http://myurl.example.com/AppB

I believe that I may need to enable SSL certificates between nginx and my
back-ends, but I couldn't find clear indications on how to do this online.

My nginx config file looks like this:

worker_processes 1;
daemon off;

events {
    worker_connections 1024;
}

http {
    access_log /dev/stdout;
    error_log /dev/stderr warn;

    server {
        listen              80;
        server_name         myurl.example.com;

        location /AppA {
            proxy_pass      https://localhost:9443;
        }

        location /AppB {
            proxy_pass      https://localhost:9043;
        }
    }
}

Thank you for any assistance you can provide.

JC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20190527/492f66dd/attachment.html>


More information about the nginx mailing list