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?
- 400 Bad Request – request header or cookie too large
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)’ — Missing /var/run/mysqld/mysqld.sock
- Nginx: Failed to start A high performance web server and a reverse proxy server
- Unable to locate package libapache2-mod-php7
- Nginx upstream prematurely closed connection while reading response header from upstream, for large requests
- nginx: connect() failed (111: Connection refused) while connecting to upstream – after update nginx –
- No module named ‘openpyxl’ – Python 3.4 – Ubuntu
- wget: unable to resolve host address `http’
- An unhandled lowlevel error occurred. The application logs may have details
- HAProxy vs. Nginx
- how to search for a directory from the terminal in ubuntu
- nginx progy pass doesn’t work in WordPress admin
- Prompted for FTP details even with FS_DIRECT set to true
- WordPress redirecting connections on port 8080 to 80
- Nginx – Prevent Access to Debug file [closed]
- NGINX Multisite Rewrite rules
- In terms of performance – Is unmanaged VPS better than a managed one – for WP sites?
- How to setup 301 redirects for multiple query string URLs?
- 404 error on homepage when using Nginx proxying to Apache
- nginx – permalinks with .php in url not working
- W3 Total Cache Minify Rewrite Error with WordPress on nginx [closed]
- Multisite WordPress nginx uploaded files throw 404
- 302 redirect to signup with nginx reverse proxy
- NGINX conf on WP Multisite enabled — subdirectory — images fail to load after updates
- Cant get wordpress to work on subdirectory
- Create subdomain masking for each user in WordPress
- wp-admin Redirects to Docker Container Name
- Permalinks keep reverting to 404 unless I re-save them
- How to run a subdirectory multisite install under a subdomain
- Infinite loop behind SSL proxy on non-standard port
- W3 Total Cache – Converting Apache rewrites to Nginx [closed]
- WordPress Permalinks & Nginx Rewrite Rule Not Working
- Site resolves to www in Firefox and without in Chrome
- WordPress Nginx Won’t 404
- Nginx — WordPress multisite with root folder in own directory
- Blog has an infinite redirect loop
- Is it safe to give wordpress directories ownership to www-data?
- WordPress sub-directory on other server running on nginx?
- Username Variable in custom links?
- Something is injecting a slash after any static file response , server is nginx
- Why WordPress w/ Nginx Multisite Only Lets Admin Upload ZIP Plugins But Not Themes? [closed]
- How to access wordpress from domainB which is installed at domainA
- 413 Request Entity Too Large nginx/1.18.0 (Ubuntu)
- Serve WordPress site as root domain with WordPress files in subdirectory in nginx server
- Why are the latest visits to my website originating from my own website?
- Editors can’t edit but administrators can
- Theme Load Error
- Apache extensions for WordPress’ working without troubles
- What are the functional differences between .profile .bash_profile and .bashrc
- How to force or redirect to SSL in nginx?
- How do I add Access-Control-Allow-Origin in NGINX?
- Setting expires headers for static content served from nginx
- What does this nginx error “rewrite or internal redirection cycle” mean?
- How to use nested Nginx location blocks (prefixes vs. regex directives)?
- Nginx Redirect via Proxy, Rewrite and Preserve URL
- How can I improve and optimise my wordpress web server for better performance in 2023