Run two services in the same domain on different ports

2

I need to configure an application that has two separate services running on port 80 and another on 8080, but on the same domain. I ask you if it is possible and how could you configure them that way?

Example:

meuunicodominio.com.br:80 path: /var/www/appfrontend

meuunicodominio.com.br:8080 path: /var/www/appbackend

The question for this feat is the use of two technologies, in 80 PHP wheel and 8080 wheel node.js, I have no option to create subdomains or add another domain, at most I can use the IP of the machine to point the backend .

    
asked by anonymous 23.11.2015 / 06:55

1 answer

3

In the documentation there are examples of how to set up: link

Configuration example:

server {
    listen       80;
    server_name  foo.bar  www.foo.bar;
    root         /var/www/foo.bar/
}

server {
    listen       8080;
    server_name  bar.foo  www.bar.foo;
    root         /var/www/bar.foo/
}
    
23.11.2015 / 07:53