As nginx has ajp module implemented I suggest my configuration for those who are interested. This was used to add SSL frontend to intranet Razuna working with http, but soon this config was found to work faster, than http frontend suggested at razuna wiki page.
user nginx nginx;
worker_processes 2;
error_log /var/log/nginx/error_log info;
events {
worker_connections 1024;
use epoll;
}
http {
upstream tomcats {
server 127.0.0.1:8009;
keepalive 10;
}
ajp_keep_conn on;
ajp_pass_request_body on;
ajp_pass_request_headers on;
ajp_max_temp_file_size 0;
ajp_cache off;
client_max_body_size 0;
ajp_store off;
ajp_connect_timeout 120;
ajp_send_timeout 1200;
server {
listen 80 default;
server_name dam.mydo.main;
access_log /var/log/nginx/localhost.http_access_log main;
error_log /var/log/nginx/localhost.http_error_log info;
root /path-to-tomcat/webapps/razuna;
location /assets {
# This is used for /assets not to be processed in any other section
root /path-to-tomcat/webapps/razuna;
}
location = / {
#This is “bootstrap” section to make first coming user get index.cfm
rewrite ^(.*)$ /index.cfm break;
ajp_pass tomcats;
}
location / {
# ajp_pass tomcats; This is intentionally commented : post requests go directly with lines below, all CFM-containing URLs are caught with CFM section and all other files (pictures, JS, css etc) are served here with nginx, not tomcat.
# All POST requests go directly
if ($request_method = POST) {
ajp_pass tomcats;
break;
}
}
location ~ \.cfm$ {
ajp_pass tomcats;
}
}
}
}