Nginx configuration for Tomcat Web Applications - HaymonEdmur/DockerConfiguration GitHub Wiki

How to add web Application URL to Nginx configuration

  • In following configuration directory create your file mywebapp.conf
  # cd  /etc/nginx/conf.d 
  • Application configuration
  # cat /etc/nginx/conf.d/mywebapp.conf 
  server {
  listen 81;
  server_name nginx-hostname-dns;

  location / {
    proxy_pass http://BackendLinuxServer:####/;
  }
  location /xxx {
    proxy_pass http://<Classic-Load-Balancer>:#/zzzz
  }
  location /zzz {
    proxy_pass http://<Application-Load-Balancer>:#/yyyy
  }
}

BackendLinuxServer can be EC2 instance or AWS internal load balancer

Shake Nginx

# nginx -t 
# nginx -s reload 
⚠️ **GitHub.com Fallback** ⚠️