Drew
Drew

Reputation: 738

Nginx: Multiple PHP sites on different ports, on 1 server

newbie on web administration and was tasked to do the following:

Is this possible? Can this be achieved using virtual hosts? I'm asking this because most of our web apps are using the laravel framework. Please point me to the correct tuts.

Upvotes: 0

Views: 10134

Answers (1)

ashatrov
ashatrov

Reputation: 1122

Because you have not provided your config, the answer is very general:

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

server {
    listen       81;
    server_name  *.example.org;
    ...
}

server {
    listen       82;
    server_name  mail.*;
    ...
}

server {
    listen       83;
    server_name  ~^(?<user>.+)\.example\.net$;
    ...
}

If you don't want to use domain, you can skip server_name.

Articles for you:

Upvotes: 6

Related Questions