M
M
MrKMV342015-09-08 18:31:36
Nginx
MrKMV34, 2015-09-08 18:31:36

Why can't I change server_name in Nginx?

Hello.
I need to make it so that on my local computer, when I type in the koblikov.org browser, Nginx gives a static page.
I have Nginx 1.4.6 installed on Ubuntu 14.04.
/etc/nginx/sites-available has default and koblikov.org. default text:

server {
  location / {
    root /home/kmv/WebProjects/УИТС;
  }
}

server {
  root /usr/share/nginx/html;
  index index.php index.html index.htm;

  # Make site accessible from http://localhost/
  server_name localhost;

  location / {
    try_files $uri $uri/ =404;
  }

  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
  }
}

Text koblikov.org:
server
{
    server_name koblikov.org;
  
    root /home/kmv/WebProjects/УИТС/Лаб1;
  
    index index.php index.html index.htm;
  
    # use fastcgi for all php files
    location ~ \.php$
    {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

I restarted nginx and tried " koblikov.org " and "koblikov.org", while localhost normally gives sites.
How to make koblikov.org accessible?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question