nginx: https proxy for http backend

This come up in many cases. Typical secanario for tomcat based applications.

location / {
            proxy_set_header             Host            $host;
            proxy_set_header             X-Real-IP       $remote_addr;
            proxy_set_header             X-Forwarded-For $proxy_add_x_forwarded_for;
            client_max_body_size      10m;
            client_body_buffer_size   128k;
            proxy_connect_timeout     90;
            proxy_send_timeout          90;
            proxy_read_timeout           90;
            proxy_buffers                       32 4k;
            proxy_cache             off;

            proxy_pass   http://localhost:8080;
            proxy_redirect   default;
            proxy_redirect   http://tomcat.rtfm.co.hu/  /;
            proxy_redirect   http://localhost:8080/ https://tomcat.rtfm.co.hu/;
        }
avatar

About tompos

Hungary, Budapest
This entry was posted in IT. Bookmark the permalink.

Leave a Reply