Nginx operates within the directory, so if you can’t cd
to that directory from the nginx user then it will fail (as does the stat
command in your log). Make sure the www-user
can cd
all the way to the /username/test/static
. You can confirm that the stat
will fail or succeed by running
sudo -u www-data stat /username/test/static
In your case probably the /username
directory is the issue here. Usually www-data
does not have permissions to cd
to other users home directories.
The best solution in that case would be to add www-data
to username
group:
gpasswd -a www-data username
and make sure that username
group can enter all directories along the path:
chmod g+x /username && chmod g+x /username/test && chmod g+x /username/test/static
For your changes to work, restart nginx
nginx -s reload
Related Posts:
- nginx – nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
- How to verify if nginx is running or not?
- ping: google.com: Temporary failure in name resolution [closed]
- Docker System has not been booted with systemd as init system
- CentOS vs. Ubuntu [closed]
- Docker error : no space left on device
- How to establish ssh key pair when “Host key verification failed”
- localhost/phpinfo.php
- After installing with pip, “jupyter: command not found”
- gpg: no valid OpenPGP data found
- gpg: no valid OpenPGP data found
- E: Unable to locate package mongodb-org
- How to open the terminal in Atom?
- Valgrind permission denied on file
- How to install Boost on Ubuntu
- pdflatex not found. pdflatex is needed for pdf output
- PIP Could not find any downloads that satisfy the requirement SQLAlchemy
- MySQL: How to reset or change the MySQL root password?
- Removing all installed OpenCV libs
- Vim: No write since last change, even though I changed the file
- Why can’t I print to terminal with my python script?
- How to kill a process on a port on ubuntu
- whats the meaning of curl “-s” and “-m”
- How do I ask apt-get to skip any interactive post-install configuration steps?
- Difference in sites-available vs sites-enabled vs conf.d directories (Nginx)?
- How to view all ssl certificates in a bundle?
- How to remove the “installed manually” flag and revert to “automatically installed” with apt-get?
- How do I get apt-get to ignore some dependencies?
- Can I hide all server / os info?
- How do I auto-start docker containers at system boot?
- How do I reattach to Ubuntu Server’s ‘do-release-upgrade’ process?
- How to determine JAVA_HOME on Debian/Ubuntu?
- How to start/stop iptables on Ubuntu?
- Which ports do I need to open in the firewall to use NFS?
- list all packages from a repository in ubuntu / debian
- dpkg-reconfigure: unable to re-open stdin: No file or directory
- How can I edit the welcome message when ssh start?
- How does Ubuntu keep track of the “System restart required” flag in motd?
- Amazon Linux vs. Ubuntu for Amazon EC2 [closed]
- Automate the installation of postfix on Ubuntu
- Best location to keep SSL certificates and private keys on Ubuntu servers?
- Why is ssh agent forwarding not working?
- Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?
- 400 Bad Request – request header or cookie too large
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- Undefined function mysql_connect()
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- How to find which version of TensorFlow is installed in my system?
- Undefined function mysql_connect()
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- How can I use environment variables in Nginx.conf
- error: command ‘gcc’ failed with exit status 1 while installing eventlet
- error: command ‘gcc’ failed with exit status 1 while installing eventlet
- “413 Request Entity Too Large” in Nginx with “client_max_body_size” set
- apt-get error: Sub-process /usr/bin/dpkg returned an error code (1)
- What is a clearfix?
- “Couldn’t find a file descriptor referring to the console” on Ubuntu bash on Windows
- How can I completely uninstall nodejs, npm and node in Ubuntu [closed]
- What does ERR_SPDY_PROTOCOL_ERROR mean in nginx?
- How to install python3 version of package via pip on Ubuntu?
- error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’ — Missing /var/run/mysqld/mysqld.sock
- Why does the terminal show “^[[A” “^[[B” “^[[C” “^[[D” when pressing the arrow keys in Ubuntu?
- error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’ — Missing /var/run/mysqld/mysqld.sock
- Possible reason for NGINX 499 error codes
- “E: Unable to locate package python-pip” on Ubuntu 18.04 [duplicate]
- Terminal error: zsh: permission denied: ./startup.sh
- E: unable to locate package pip
- How to solve “Kernel panic – not syncing – Attempted to kill init” — without erasing any user data
- How can I use an .htaccess file in Nginx?
- “E: Unable to locate package python-pip” on Ubuntu 18.04 [duplicate]
- How to install “make” in ubuntu?
- “sed” command in bash
- Nginx: Failed to start A high performance web server and a reverse proxy server
- HAProxy vs. Nginx
- How to restart remote MySQL server running on Ubuntu linux?
- Ubuntu: OpenJDK 8 – Unable to locate package
- using pip3: module “importlib._bootstrap” has no attribute “SourceFileLoader”
- Failed to start mongod.service: Unit mongod.service not found
- WSL – GEDIT Unable to init server: Could not connect: Connection refused
- How to tell if tensorflow is using gpu acceleration from inside python shell?
- docker command not found even though installed with apt-get
- How to open some ports on Ubuntu?
- Error: A JNI error has occurred, please check your installation and try again – during running Java program from Ubuntu terminal
- Nginx 403 forbidden for all files
- Uncompress tar.gz file
- Delete all local git branches
- Ubuntu ‘-bash: nano: command not found’
- Unable to install gem – Failed to build gem native extension – cannot load such file — mkmf (LoadError)
- “Unable to find remote helper for ‘https'” during git clone
- bash : Bad Substitution
- Unable to locate package libapache2-mod-php7
- Laravel 5.2 Storage::makeDirectory($dir) is not creating directory
- How to fix “unsupported class file major version 60” in IntelliJ?
- Node.js + Nginx – What now?
- Nginx upstream prematurely closed connection while reading response header from upstream, for large requests
- NGINX: upstream timed out (110: Connection timed out) while reading response header from upstream
- “psql: could not connect to server: Connection refused” Error when connecting to remote database
- Package php5 have no installation candidate (Ubuntu 16.04)
- pip connection failure: cannot fetch index base URL http://pypi.python.org/simple/
- What is the difference between /etc/rc.local and ~/.bashrc?