Tag Archives: nginx

Reverse Proxy Nginx -> Tomcat

reverse proxyWe need two servers:

  • NGINX
    • Serve static files
    • Serve maintenance page
    • Control access via GeoIP tables
    • Offer HTTPS protocol to clients (443)
    • Maintain reverse proxy to Tomcat on HTTP
  • TOMCAT
    • Will hold deployed application
    • Communicates on port 8080

For a reverse proxy we need to configure nginx:

nginx.conf

 

site.conf

 

Tomcat configuration more simple:

server.xml

Nginx and gzip_static

Gzip static module allows you to serve per-compressed files instead of “on the fly” compressed files.

Nginx:

 

Python script

we do need to build the gzip files every time we do update our project. This script will scan all files in resource directory and gzip each file: