deploying a laravel site on ubuntu 22.04 server

Viewed 23

I am trying to deploy my laravel application on an Ubuntu 22.04 server on digital ocean using the LEMP stack... So I have already installed Linux, Nginx, all the PHP dependencies and configured the database and added a new user. Here is how my /sites-available/zili-zala.com looks like

server {
    listen 80;
    server_name zili-zala.com www.zili-zala.com;
    root /var/www/zili-zala.com/public;

    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;

    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; }


    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

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

Here's how my .env looks like

APP_NAME=soko
APP_ENV=production
APP_KEY=****
APP_DEBUG=true
APP_URL=example.com

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mydatabase
DB_USERNAME=myusername
DB_PASSWORD=mypassword

I have already given the server user write access to the storage and cache folders. I have also added the symbolic link to the sites enabled file. But when I go to the browser I get a blank screen. I still dont know what is happening. Any help will be appreciated.

0 Answers
Related