Is there some way to run java servlet on nginx?
June 16, 2012 06:43PM
I have an website which uses Apache Tomcat running java servlet, I understand that Nginx run FastCGI and PHP for web applications support, I would like to know if is there some way to run java servlet on nginx or if is there some project with this objective?

Re: Is there some way to run java servlet on nginx?
September 22, 2012 03:25PM
I'm running several Tomcat 7 instances. Proxying was fairly easy though HTTP/1.1 with persistent connection took a bit to get right (use the debug error log to find out).

Here's part of my configuration:

http {

upstream tomcat3 {
keepalive 1;


server {

listen [::]:81;


root /var/www/$host;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://tomcat3;
proxy_pass_header server;
gzip_vary off;

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 131
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready