# Nginx proxy for tomcat 6 with SSL

**URL:** <https://www.ruby-forum.com/t/nginx-proxy-for-tomcat-6-with-ssl/200215>\
**Category:** NGINX\
**Created:** [December 7, 2010, 8:20am UTC](https://www.ruby-forum.com/t/nginx-proxy-for-tomcat-6-with-ssl/200215 "2010-12-07T08:20:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [December 7, 2010, 8:20am UTC](https://www.ruby-forum.com/t/nginx-proxy-for-tomcat-6-with-ssl/200215/1 "2010-12-07T08:20:42Z")

</div>

Hi,

I am very new to nginx and i need some advice.

I have set up nginx reverse proxy for tomcat

Client ------\> Nginx proxy -----\> tomcat

The client uses ssl connection to ngnix and another ssl connection from  
there to tomcat server.

My nginx.conf is given below.

[color=#990033]user www-data;  
worker\_processes 1;  
#server\_names\_hash\_bucket\_size 32;  
error\_log /var/log/nginx/error.log;  
pid /var/run/nginx.pid;

events {  
worker\_connections 1024;  
}

http {

geoip\_country /etc/nginx/GeoIP.dat;  
geoip\_city /etc/nginx/GeoLiteCity.dat;

default\_type application/octet-stream;  
server\_names\_hash\_bucket\_size 33;

#### Log Format

log\_format main '$remote\_addr - $remote\_user [$time\_local] $status ’  
‘“$request” $body\_bytes\_sent “$http\_referer” —  
“$request\_length”’  
‘“$http\_user\_agent” “$http\_x\_forwarded\_for” – “$request\_uri”’  
‘“$geoip\_country\_code” – “$geoip\_city” – “$geoip\_region” –  
“$geoip\_postal\_code”’;

client\_header\_buffer\_size 1k;  
large\_client\_header\_buffers 4 1k;

```
server {

  server_name emr.spectramedi.com www.emr.spectramedi.com;
  listen 192.168.25.93:443;

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

```

### SSL Configurations

```
  ssl on;
  ssl_certificate /etc/nginx/emr_spectramedi_com.crt;
  ssl_certificate_key /etc/nginx/emr.key;

```

### Reject requests for Uri with more than 100 characters###

if ($request\_uri ~ ‘.{100}’) {  
return 444;  
}

### Reject requests for Uri with ‘.’ & ‘?’

if ($request\_uri ~ ‘[.?]’) {  
return 444;  
}

client\_max\_body\_size 30M;  
client\_body\_buffer\_size 128k;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;

location / {

```
       proxy_pass https://10.10.1.2/manager/html/;
       proxy_redirect off;

```

}  
}  
}[/color]

I need tomcat’s manager application to be loaded when the client  
connects to the site. So i have made

[b]proxy\_pass [https://10.10.1.2/manager/html/;[/b]](https://10.10.1.2/manager/html/;%5B/b%5D)

After making this change i get the tomcat manager page as default, which  
is fine.  
But when i try to access the link for [color=#000066]Server status  
page[/color],  
it shows the following error :-

FAIL - Unknown command /manager/status

This error was not there when i used proxy\_pass [https://10.10.1.2/](https://10.10.1.2/);  
in nginx.conf

please help

Posted at Nginx Forum:

> **[Nginx Forum :: Nginx Mailing List - English](https://forum.nginx.org/read.php?2,156318,156318#msg-156318)**
>
> A portal to and from the mailing list.
