Nginx proxy for tomcat 6 with SSL


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/;

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” —
‘“$http_user_agent” “$http_x_forwarded_for” – “$request_uri”’
‘“$geoip_country_code” – “$geoip_city” – “$geoip_region” –

client_header_buffer_size 1k;
large_client_header_buffers 4 1k;

server {


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


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


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
it shows the following error :-

FAIL - Unknown command /manager/status

This error was not there when i used proxy_pass;
in nginx.conf

please help

Posted at Nginx Forum: