Troubleshooting

Nginx Issues

Configuration test fails

sudo nginx -t

Check the error message for syntax issues. Common causes:

  • Missing semicolons in config directives

  • Invalid SSL certificate paths

  • Port conflicts with other services

403 Forbidden on WebDAV

  • Check directory ownership:

    # Debian
    ls -la /var/www/html/webdav/
    # Should be owned by www-data:www-data
    
    # CentOS
    ls -la /var/www/html/webdav/
    # Should be owned by nginx:nginx
  • Check SELinux (CentOS only):

    sudo setsebool -P httpd_can_network_connect 1
    sudo chcon -R -t httpd_sys_rw_content_t /var/www/html/webdav/

DAV module not found (CentOS)

If nginx -V does not show http_dav_module:

  1. Verify the module file exists: ls /etc/nginx/modules/ngx_http_dav_ext_module.so

  2. Check that nginx.conf has load_module modules/ngx_http_dav_ext_module.so; as the first line

  3. Rebuild the module if Nginx was upgraded (version must match)

413 Request Entity Too Large

The configuration sets client_max_body_size 0 (unlimited). If you still see this error, check that the directive is inside the correct location block.

FTP Issues

530 Login incorrect

  • Verify user is in the whitelist:

    grep username /etc/vsftpd/user_list
  • Verify pam_shells.so is commented out:

    grep pam_shells /etc/pam.d/vsftpd
    # Should show: #auth ... pam_shells.so
  • Verify the user exists and has a password set:

    id username
    sudo passwd username

Passive mode connection fails

  • Verify firewall allows the passive port range:

    # Debian (UFW)
    sudo ufw status | grep 49000
    
    # CentOS (firewalld)
    sudo firewall-cmd --list-ports | grep 49000
  • If behind NAT, add pasv_address=<external_ip> to vsftpd config

Permission denied on upload

  • Check ACLs:

    getfacl /var/www/html/webdav/
  • Ensure user has ACL entries:

    sudo setfacl -R -m u:username:rwx /var/www/html/webdav/
    sudo setfacl -R -d -m u:username:rwx /var/www/html/webdav/

SSL Issues

Certbot fails to obtain certificate

  • Ensure port 80 is open and accessible from the internet

  • Ensure the domain A record points to the server IP

  • Check rate limits: Let’s Encrypt has a limit of 5 duplicate certificates per week

Certificate renewal fails

# Test renewal
sudo certbot renew --dry-run

# Check certbot logs
sudo cat /var/log/letsencrypt/letsencrypt.log

SSL ports not responding

  • Check Nginx is listening on SSL ports:

    sudo ss -tlnp | grep -E '482|483'
  • Verify SSL config was appended to the Nginx configuration file

General

Check service status

sudo systemctl status nginx
sudo systemctl status vsftpd

View logs

# Nginx
sudo tail -f /var/log/nginx/webdav-*-access.log
sudo tail -f /var/log/nginx/webdav-*-error.log

# vsftpd
sudo tail -f /var/log/vsftpd.log

# System journal
sudo journalctl -u nginx -f
sudo journalctl -u vsftpd -f

Files uploaded via FTP not visible via WebDAV (or vice versa)

Both services must point to the same directory (/var/www/html/webdav/). Verify:

# Check vsftpd user config
cat /etc/vsftpd/users/<username>
# Should contain: local_root=/var/www/html/webdav/

# Check Nginx config
grep "root" /etc/nginx/conf.d/default.conf  # CentOS
grep "root" /etc/nginx/sites-available/default  # Debian
# Should contain: root /var/www/html/webdav/

If file permissions differ, reset ACLs:

sudo setfacl -R -m u:www-data:rwx /var/www/html/webdav/  # Debian
sudo setfacl -R -m u:nginx:rwx /var/www/html/webdav/     # CentOS