Welcome! Log In Create A New Profile

Advanced

Is there some way to run java servlet on nginx?

Posted by arqbispo 
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?

Thanks
Flavio
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 {
server 127.0.0.1:8081;
keepalive 1;
}

}


server {

listen [::]:81;

server_name fnuh.com;

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: 133
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready