Timbertlt

Timbertlt

Member Since 2 Weeks Ago

Experience Points
70
Total
Experience

4,930 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
70 XP
Oct
01
2 weeks ago
Activity icon

Replied to Laravel 6.0 Render Nginx 404 Error

I've created nginx config, which works in my case:

server {
    listen 80;
    server_name example.com;

    error_page 404 = /index.php;

    error_log /path_to_log/log.error.log;
    charset utf8;
    index index.php;
    root /path_web_root/example.com/public/;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    location ~* \.(jpg|jpeg|gif|css|png|js|ico|html|woff2)$ {
        access_log off;
        expires max;
        log_not_found off;
    }

    # removes trailing slashes
    if (!-d $request_filename)
    {
        rewrite ^/(.+)/$ / permanent;
    }

    if (!-e $request_filename)
    {
        rewrite ^/(.*)$ /index.php?/ last;
        break;
    }

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~* \.php$ {
        fastcgi_buffer_size 128k;
        fastcgi_buffers 4 128k;
        fastcgi_read_timeout 300;
        try_files $uri = 404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.3-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /.well-known {
        allow all;
    }

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

I'm not an nginx guru, so if you have any suggestions, please let me know.

Activity icon

Replied to Laravel 6.0 Render Nginx 404 Error

Nothing changed. I've just copied old config and changed path to public, server name, and php7.1 to php7.3.

In error log I see something like this:

2019/09/27 14:38:04 [error] 2442#2442: *258 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.56.1, server: safaribelleza3, request: "GET /dfdfdfdffd/dfdff HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.3-fpm.sock:", host: "safaribelleza3"

I tried to make the location @laravel and send requests to this location:

    location / {
        server_tokens off;
        client_max_body_size 10m;
        client_body_buffer_size 128k;
        #try_files $uri $uri/ /index.php$is_args$args;
        try_files $uri $uri/ @laravel;
    }

    location @laravel {
        fastcgi_buffer_size 128k;
        fastcgi_buffers 4 128k;
        fastcgi_read_timeout 300;
        fastcgi_pass unix:/run/php/php7.3-fpm.sock;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root/index.php;
    }

With this config works everything except home page, and 404 error is rendered by laravel.

Sep
30
2 weeks ago
Activity icon

Started a new Conversation Laravel 6.0 Render Nginx 404 Error

Upgraded my app from 5.8 to 6.0.4. The nginx config is the same:

location / {
        ........
        try_files $uri $uri/ /index.php$is_args$args;
}

location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include /etc/nginx/fastcgi_params;
        ..........
        fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}

wep.php config:

.....
some app routes
.....
Route::get('/{page}',[
    'uses'  => '[email protected]',
    'as'    => 'page'
]);

Route::fallback('[email protected]');

On laravel 5.8 if the route does not exist, I get 404 error rendered by laravel.

On laravel 6.0 I get nginx 404 error.

Is it the problem with laravel routing or do I need to change something in nginx config?