PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Unsolved

Laravel forge NGINX config for wave

corybowden

Jun 20th, 2020 06:29 PM

Can anyone help with the proper nginx config for wave with laravel forge. Cannot access the admin or any of the assets.

bobbyiliev

Jun 21st, 2020 07:01 AM

Hi there,

What I would suggest here is updating your APP_URL to match your domain name exactly. This should fix the issue with the static files not being loaded.

Let me know how it goes!

corybowden

Jun 21st, 2020 02:40 PM

Hey Bobby, The APP_URL was updated as soon as I put it on forge.

bobbyiliev

Jun 21st, 2020 07:36 PM

Hi there,

Would you mind sharing the current Nginx config that you are using?

Wave is based on Laravel and Voayger and it should work with the standard Nginx serevr block for Laravel.

Here is the one that I usually use for my Laravel projects:

https://github.com/bobbyiliev/laravel-nginx-server-block/blob/master/laravel-nginx-server-block

corybowden

Jun 21st, 2020 08:56 PM

Hey Bobby, Here is the server block, its being hosted on digital ocean with forge.

# FORGE CONFIG (DO NOT REMOVE!)
  include forge-conf/dev.asanapeeps.com/before/*;

 server {
   listen 80;
   listen [::]:80;
   server_name dev.asanapeeps.com;
   server_tokens off;
   root /home/forge/dev.asanapeeps.com/public;

# FORGE SSL (DO NOT REMOVE!)
# ssl_certificate;
# ssl_certificate_key;

ssl_protocols TLSv1.2;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/dhparams.pem;

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

index index.html index.htm index.php;

charset utf-8;

# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/dev.asanapeeps.com/server/*;

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

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

access_log off;
error_log  /var/log/nginx/dev.asanapeeps.com-error.log error;

error_page 404 /index.php;

location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
}

location ~ /\.(?!well-known).* {
    deny all;
}
}

# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/dev.asanapeeps.com/after/*;
tnylea

Jun 21st, 2020 09:51 PM

Hey Cory,

It looks like the assets are not being linked correctly. Have you run the following command on your server:

php artisan storage:link

This will create the symlink folder for your assets and images. I'm pretty sure that should solve your issue, but if not let me know and I can take a look into it further ;)

Report
1