NGINX domain shows different directory?
I just started with my linode, I'm still a noob but wanted to give it a go. I followed the linode LEMP documentation and I added 2 domains on my linode.
1. cloudening.com
2. vaughancorp.com
Now the weird thing is when I go to vaughancorp.com I can see the website normally. But now when I go to
> I did a: tail /var/log/nginx/error.log and this is the result:
2018/02/12 20:57:11 [error] 14017#14017: *20 directory index of "/var/www/html/cloudening.com/public_html/" is forbidden, client: 49.xxx.xxx.xxx, server: cloudening.com, request: "GET / HTTP/1.1", host: "
www.vaughancorp.com "
So the above error log is showing that it's accessing the public_html folder of cloudening
But the Nginx virtual host settings for vaughancorp.com is:
server {
listen 80;
listen [::]:80;
server_name vaughancorp.com;
root /var/www/html/vaughancorp.com/public_html;
index index.php index.html;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME /var/www/html/vaughancorp.com/public_html$fastcgi_script_name;
}
}
So it got me thinking that it might be on my domain manager, so what I did was I deleted the A record of hostname www and then added a cname of www that points to vaughancorp.com, but still did not work.
Now if I view cloudening.com and
And now if I go to
Your thoughts? Thanks!
1 Reply
server_name vaughancorp.com
Hope this helps newbies like me.