Answer the question
In order to leave comments, you need to log in
Learning to configure ngnix, what's wrong with my settings?
I decided to take a VPS for myself, I want ngnix to display a static index.html page when they visit the domain, but I realized that it's not so simple.
Can't configure server, here is my ngnix.conf file
user www-data;
worker_processes auto;
events {
use epoll;
worker_connections 1024;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log crit;
keepalive_timeout 30;
keepalive_requests 100;
client_max_body_size 1m;
client_body_timeout 10;
reset_timedout_connection on;
send_timeout 2;
sendfile on;
tcp_nodelay on;
tcp_nopush on;
gzip on;
gzip_disable "msie6";
gzip_proxied any;
gzip_min_length 1024;
gzip_comp_level 4;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+r$
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
include /etc/nginx/sites-enabled/*;
}
server {
listen 80;
charset utf-8;
root /var/www/itant;
server_name sdfswdvfa.ru;
access_log /var/log/nginx/it_anthill_access.log;
error_log /var/log/nginx/it_anthill_error.log;
location / {
index index.php index.html;
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
server_name www.adsfsdf.ru;
rewrite ^(.*) http://asdgfawef$1 permanent;
}
Answer the question
In order to leave comments, you need to log in
Your domain is not directed, even the browser says so.
From your comment it is clear that you sent all subdomains to your server, except for the main domain. To fix it, in the second A record, change www to @ and wait, it doesn't change instantly.
to find out what nginx is complaining about, run the command before restarting:
it will swear at those lines in those files that it does not like
...
the folder with the error is named - you need sites-available
Then just create the sites-enabled
folder. link:
and restart nginx:
To see if the server is working or not:
Also: maybe the DNS has not been updated yet, the domain has just been registered, maybe the NS servers have been changed?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question