Well crap. I guess you must not even have been able to get far enough in the startup process to generate an error log, or because of the permissions issues referenced in the original post that started this thread. That sucks
Don’t worry though, we’ll get this figured out!
Based on your original post, I think that there are a few things that need to be checked.
Could you run the command ufw allow 80
and ufw allow http
to make sure that your firewall is allowing port 80 (the default HTTP protocol port) to transmit data.
This leads me to think that there may have been an error made in the configuration of the Nginx server configuration file. I’d like to personally take a look, if your willing to share the contents of the file with me. You can retrieve the contents by using the following command: cat /etc/nginx/nginx.conf
and copy/pasting the resulting output here.
I’d like to check the permissions of the directories leading up to the /var/log/nginx/error.log
file, and then the permissions of the error.log
file itself. We can do this by running the following commands:
- Check the permissions of the folder
/var/
with the command ls -alh /
(we need to see the folder var
’s own permissions, which is why we have to start a folder back, as we will need to do for each of the following. Don’t worry about going a folder back, the commands I’m providing here take care of that for you 
- Check the permissions of the folder
/var/log/
with the command ls -alh /var/
this will show us the contents of the folder /var/
including the folder /log/
.
- Check the permissions of the folder
/var/log/nginx/
with the command ls -alh /var/log/
This will allow us to see the folder nginx
’s permissions in the file system.
- Finally, the error logs themselves, which can be done with the command
ls -alh /var/log/nginx/
.
As a reference, I have included a screenshot of my own web server in which I ran the command ls -alh /var/log/nginx/
to provide a sample of what the expected output should look like, seen below.

As a bit of an explanation of the output information that you will be getting with the command ls -alh [filepath]
, I wanted to include the following. If your not interested or you already know this, by all means feel no obligation to read any further, If nothing else it’ll be a reference for other forum users.
Let us use the example from the screenshot I provided, the line
-rw-r----- 1 www-data adm 0 Sep 15 02:25 access.log
This section containing -rw-r-----
is telling us the actual permissions of the file itself, where r
stands for read permissions, w
stands for write permissions, and (although this file doesn’t have this permission, so you cannot see it) e
stands for execution permissions, or in other words, permission to run the program.
The number 1
following the previous represents the number of objects contained within the file, which, because there are no folders located within the text file, is 1, for itself.
Following the 1
is www-data adm
which tells the human the file’s owner and group assignment within the system. This is very important. If the group and file owner is incorrectly set, this can restrict certain crucial system functions from being able to access or open the file, potentially resulting in the error permission denied message such as the one found in your initial post.
Following the system group and owner is the file size, converted from plain bytes into a human-readable format with the flag -h
in the command ls
. Because I use the Apache webserver for my Mattermost instance, and do not run Nginx except as a backup, my error.log file has a size of 0
, meaning that it is an empty file.
Finally, after the file size, you have the date and time that the file was last modified, and then the name of the file itself!