404 Not found Laravel on Ubuntu 14.04 with nginx

October 13, 2014 2k views

Hello Everyone, i'm trying to installing Laravel on my droplet when i'm done with the installation step The laravel works fine when i access it to the IP Address but i've got 404 when i access it using my domain. here's my nginx configuration:

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

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

    server_name abc.efg.domain.xy.yz;

    try_files $uri $uri/ @rewrite;

    location @rewrite{
        rewrite ^/(.*)$ /index.php?_url/$1;

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;

    location ~ \.php$ {
        try_files $uri /index.php  =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;

1 comment
  • Are you certain that the domain is correctly pointing to the IP address? Does the output of dig abc.efg.domain.xy.yz +short return the IP address of your droplet?

Be the first one to answer this question.