Step 5 — Creating a PHP File to Test Configuration, Show 404 Not Found

How To Install Linux, Nginx, MariaDB, PHP (LEMP stack) on Debian 10_

Above is OK. Step 4 — Configuring Nginx to Use the PHP Processor My_domain is “

$ sudo mkdir /var/www/
$ sudo chown -R $USER:$USER /var/www/
$ sudo nano /etc/nginx/sites-available/
server {
    listen 80;
    listen [::]:80;

    root /var/www/;
    index index.php index.html index.htm;


    location / {
        try_files $uri $uri/ =404;

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
$ sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
$ sudo nginx -t
$ sudo systemctl reload nginx

Step 5 — Creating a PHP File to Test Configuration, Show 404 Not Found

$ nano /var/www/your_domain/info.php

Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

404 Not Found

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


There are a few things that I could suggest:

  • First make sure that your /var/www/your_domain/ folder is owned by the Nginx user. To do that first check what the Nginx user is:
sudo ps aux | grep -i nginx

Then get the user and run this command:

chown -R THE_NGINX_USER:THE_NGINX_USER /var/www/your_domain
  • If this does not help make sure to check your Nginx error log:
tail -100 /var/log/nginx/error.log

Feel free to share any errors here so that I could try to advise you further.

Hope that this helps! Regards, Bobby