nginx host static files

Home

https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/


server {
        listen 80;
        listen [::]:80;

        server_name snarvaez.poweredbygnulinux.com ;      

       # it is easy to host directly inside /var/www to avoid permissions problems
       root /var/www/snarvaez.poweredbygnulinux.com/public_html;


       location / {

              # allow to display directory listings
              autoindex on;
              
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }
}


Author: Sebastian Emilio Narvaez

Created: 2023-05-21 Sun 17:44

Validate