Answer the question
In order to leave comments, you need to log in
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;
}
}
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;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question