I am trying to set up an nginx install on a Amazon Lightsail VPS running Debian (not the Nginx Bitnami package). I'm a bit of a newbie at this. I'm totally puzzled by what is happening.
Output of ls -l /etc/nginx/sites-enabled
:
lrwxrwxrwx 1 root root 39 Jul 27 16:39 static -> /etc/nginx/sites-available/static
Contents of /etc/nginx/sites-available/static
:
server { listen 80; listen [::]:80; server_name 'DOMAIN NAME' www.'DOMAIN NAME' www1.'DOMAIN NAME' 'IP ADDRESS OF SERVER' root /var/www/static index index.html; location / { index index.html; try_files $uri $uri/ =404; } }
In the above, DOMAIN_NAME
and IP ADDRESS
are placeholders for the real text.
Output of nginx -T
shows the contents of static
displayed after the contents of /etc/nginx/nginx.conf
. There are no server-name
lines in this output except what's in static
.
/var/log/nginx/access.log
shows accesses when I enter the main domain name, but not the subdomain names. In any case, whether I enter the subdomain or just the main domain, I am shown the welcome page.
What's even more mystifying is that the welcome page seems to be at /var/www/html/index.html
. So I modified that file too as a test. But the modified version wasn't displayed either.
I'm at my wit's end. What have I done wrong?
/var/www/static
instead of/var/www/html
;
? Your example shows some missing;
s./var/www/static
- that's the problem at present.