Posted On October 24, 2022

Quick Note on Tomcat with NGINX

kimconnect 0 comments
blog.KimConnect.com >> Linux >> Quick Note on Tomcat with NGINX

Below is a quick short-hand note to remind oneself to setup proxying properly between Tomcat and NGINX.

Edit this file: /etc/apache2/sites-enabled/portal.dragoncoin.conf

Add this content:

server {
    server_name  portal.dragoncoin.com;

    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:80; # where 80 is the port of the tomcat app
    }
}

Edit this file: /etc/nginx/nginx.conf

Find this:

http { ... }

Add this content:

include /etc/apache2/sites-enabled/portal.dragoncoin.conf

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Logical Volume Manager (LVM) in Red Hat

Overview Most modern Linux versions are compatible with LVM, an open source equivalent to Storage…

Linux: How to set a static IP address

Set Static IP Address ---- vim /etc/sysconfig/networking/profiles/default/ifcfg-eth0 vim /etc/sysconfig/network-scripts/ifcfg-eth0 ---- DEVICE=eth0 BOOTPROTO=none HWADDR=00:0C:29:d7:5b:d3 ONBOOT=yes TYPE=Ethernet…

Add or Remove a User / Users in CentOS / Redhat Linux

sudo adduser usernamesudo passwd usernamesudo gpasswd -a username wheel#Check wheel groupsudo lid -g wheel#Delete user:userdel…