Nginx as Reverse Proxy for Tomcat + SSL

himesh nginx-forum at
Thu Nov 19 14:50:02 MSK 2009

Thanks Maxim,

So i tried the setup, SSL connection between the client and Nginx ( ssl terminating at nginx) and then unencrypted from Nginx to Tomcat.
This is what my nginx.conf file looks like....

user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log;
pid        /var/run/;

events {
    worker_connections  1024;

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    access_log  /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;

    include /etc/nginx/sites-enabled/*;

server {

      ssl on;
      ssl_certificate /etc/pound/himesh_com.crt;
      ssl_certificate_key /etc/pound/himesh.key;

      access_log /etc/pound/access.log;

      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_redirect off;


Now form the client when i try i get the the tomcat default page, that is all good.

But ( abc is an application deployed in tomcat), the browser returns but now i don't have nginx listening on 80, so there is no answer . This only happens with https. It works fine when iam using just http..

Please advice..

Thank you,

Posted at Nginx Forum:,24126,24138#msg-24138

More information about the nginx mailing list