Score:0

Nginx reverse proxy, two applications with different domain names on the same server?

cn flag

I have two applications on the server, which have different domain names but need to be on the same IP and port. How do I do this with Nginx?

With Apache, I can do this with VirtualHost blocks, but as far as I can tell Nginx server blocks require unique listen lines.

Score:2
tl flag

Server names in nginx are defined using the server_name directive and determine which server block is used for a given request.

For example:

server {
    listen       80;
    server_name  example.org  www.example.org;
    ...
}

server {
    listen       80;
    server_name  server.org;
    ...
}

There are some server names that are treated specially.

Catch-all server uses the name "_":

server {
        listen       80  default_server;
        server_name  _;
    }

More details can be found here: Nginx Server names

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.