vendredi 15 novembre 2019

Nginx shows 404 error for sub link and paths

I have using nginx for laravel project. When I use the domain name it shows the home page. But When I click any one of the link it does not work. And shows 404 Not Found error.

http://www.myhomepage.com // working http://www.myhomepage.com/about // not working

I have using the following configuration.

server {
        listen 80;
        root /var/www/abc-company-website/public;

        index index.php index.html index.htm index.nginx-debian.html;

        server_name myhomepage.com localhost;

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

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        }

        location ~ /\.ht {
                deny all;
        }
}

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire