I have a production server with a domain name. It has a tomcat server on 8080. It has several web applications. So I want to map the http/https requests coming to that server to these web applications. Say www.example.com/x to web app x.

What is the best way to do this? Using Apache2? Ngnix or other tool?

1 Answer 1


I use nginx on my servers. Below is an example config that redirects traffic from port 80 to 8080:

server {
    listen       80;
    server_name  mysite.com;

    location / {
  • 1
    You need applications that handle the scheme properly. Maybe, these apps will make links to the http version even though the user is on the https version. Be careful with that. Nginx cannot rewrite URLS. Commented Jul 3, 2014 at 15:12

Not the answer you're looking for? Browse other questions tagged .