M
M
Maxim2016-03-29 15:51:58
PHP
Maxim, 2016-03-29 15:51:58

Add another local nginx domain?

There is an nginx server on Ubuntu, there is a configuration file in the conf.d folder

server {
        listen   80;
        root /home/user/www;
      
        access_log /home/user/logs/nginx.access.log; #расположение логов данного хоста

        server_name user.org www.user.org;

        location / {
                index index.php index.html index.htm;
        }

        location ~ \.php$ {
    fastcgi_pass unix:/var/run/php5-fpm.sock;                
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
        }
}

The sites-enabled folder is empty, the sites-available folder contains the default file . Added
the user/www folder along the root /home/ path.
As a result, when I follow the user.org link, the server is running. Everything set up.
But the question is, I want another site, for example dev.test, the question is how do I add it correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vanya Zyuzgin, 2016-03-29
@KidsBout

Here is an example symlink for default:

ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default

A
Alexander, 2016-03-29
@disc

Make another config file in the sites-available directory and symlink to it in sites-enabled

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question