Assumptions
- Tomcat or other app-server is running in port 8080 in the same system.
- It is assumed that all requests are forwarded to Tomcat (see the location directive in the configuration below).
- Your domain name is assumed to be domain.tld.
Nginx Configuration
server {
listen 80;
server_name domain.tld;
access_log /var/log/nginx/domain_tld.access.log;
location / {
proxy_pass http://127.0.0.1:8080;
}
}
Copy this file (Can name this file to anything. I name it domain_tld as a convention.) to /etc/nginx/sites-enabled/ folder. We need to remove the any default file in the sites-enabled directory.
|