Laravel 5 & Laragon 3 nginx 404 not found


  • | 810 points

    Good day Everyone,

    I have Windows server running Laragon & nginx/1.12.0.
    On the local machine I can browse my web app. But when browsing from a remote pc on the network then I can only browse the index page.

    Any other URI's give me an "404 not found" error.

    Please give me step by step which conf files and what need to change.

    00-default.conf:

    server {
    listen 8080 default_server;
    #listen 4433 ssl default_server;
    server_name localhost ;
    root "C:/laragon/www/";

    index index.html index.htm index.php;
    
    # Access Restrictions
    allow       127.0.0.1;
    deny        all;
    
    include "C:/laragon/etc/nginx/alias/*.conf";
    
    location / {
        try_files $uri $uri/ =404;
    }
    
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass php_upstream;		
        #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
    
    # Enable SSL
    #ssl_certificate "C:/laragon/etc/ssl/default.crt";
    #ssl_certificate_key "C:/laragon/etc/ssl/default.key";
    #ssl_session_timeout 5m;
    #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
    #ssl_prefer_server_ciphers on;
    
    
    charset utf-8;
    
    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }
    location ~ /\.ht {
        deny all;
    }
    

    }

    auto.labelx.dev.conv

    server {
    listen 8080;
    server_name labelx.dev *.labelx.dev;
    root "C:/laragon/www/labelx/public/";

    index index.html index.htm index.php;
    
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
    
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass php_upstream;		
        #fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
    
    
    charset utf-8;
    
    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }
    location ~ /\.ht {
        deny all;
    }
    

    }

    This file is auto-generated.

    If you want Laragon to respect your changes, just remove the [auto.] prefix

    If you want to use SSL, enable it by going to Menu > Nginx > SSL > Enabled

    nginx.conf:

    #user nobody;
    worker_processes 1;

    #error_log logs/error.log;
    #error_log logs/error.log notice;
    #error_log logs/error.log info;

    #pid logs/nginx.pid;

    events {
    worker_connections 1024;
    }

    http {
    include mime.types;
    default_type application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';
    
    #access_log  logs/access.log  main;
    
    sendfile        on;
    #tcp_nopush     on;
    
    #keepalive_timeout  0;
    keepalive_timeout  65;
    
    #gzip  on;
    
    include "C:/laragon/etc/nginx/php_upstream.conf";
    include "C:/laragon/etc/nginx/sites-enabled/*.conf";
    client_max_body_size 2000M;
    

    }

    Thanks in advance :)


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.