Category : nginx

I am trying to display my logs on my website to verified users in Laravel based on my role based access control. $file = fopen("/var/log/auth.log", "r") or die(); $content = fread($file, filesize("/var/log/auth.log")); fclose($file); This hits me with an error: fopen(/var/log/auth.log): failed to open stream: Permission denied I can see that Laravel does not have the ..

Read more

I just install my nginx server on my windows laptop. Then I setup the nginx.conf file like this : server { listen 80; server_name laravelninja.local; root C:/blablabla/public; index index.php; location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } running the php-cgi using this syntax php-cgi.exe -b 127.0.0.1:9000 and the ..

Read more

I’m trying to set up an staging environment (I also intend to set up a production futhermore) for a Laravel 8 application. almost everithing is working as I expected, except for a problem caching the routes and with something wrong on nginx configuration. I created a laravel.conf file on .platfom/nginx/conf.d/elasticbeanstalk folder with the following content: ..

Read more

I started testing the new Laravel Sail docker-compose environment with an nginx reverse proxy so I can access my website from a real tld while developing on my local machine. My setup is: OS – Ubuntu Desktop 20 with nginx and docker installed. Nginx site-enabled on the host machine: server { server_name mysite.xyz; listen 443 ..

Read more

I have a Laravel project deployed with Laravel Forge in nginx. This application has several aliases. I am trying to issue ssl certificates for each aliases, but I get the following error: ERROR: Challenge is invalid! (returned: invalid) (result: ["type"] "http-01" ["status"] "invalid" ["error","type"] "urn:ietf:params:acme:error:unauthorized" ["error","detail"] "Invalid response from example.com/.well-known/acme-challenge/xxxxxxxxxxxxxxx [xxx.xx.xxx.xx]: "u003c!DOCTYPE html PUBLIC \"-//W3C//DTD ..

Read more

Having followed [https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-nginx-in-ubuntu-18-04][1] I have created serverblock as server { listen 80; server_name example.com; return 301 https://example.com$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; server_name example.com; root /var/www/html/exampleserver/public; #<ssl_certs> include snippets/self-signed.conf; include snippets/ssl-params.conf; ssl_stapling off;#switch to on if real cert ssl_stapling_verify off;#switch to on if real cert #</ssl_certs> fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; ..

Read more

I’m currently using the default configuration below, provided by Laravel here: server { listen 80; server_name www.example.com; root /srv/www/example/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; index 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 ..

Read more

Ubuntu 20.04 Docker version 19.03.14 docker-compose version 1.25.0 I’m trying to figure out why i’m getting an error related to mysql. The steps i did: Clone my laravel project docker-compose build docker-compose up -d docker-compose exec app php artisan key:generate docker-compose exec app php artisan config:cache docker-compose exec app php artisan migrate in the last ..

Read more

I have this laravel directory stucture: /app … [another-default-laravel-structure] … /dist /public My current Nginx setting is like this: server { # Make site accessible from http://localhost/ server_name example.com; error_log /some/path/to/logs-file.log; location / { # First attempt to serve request as file, then root /home/user/laravel-project/dist; index index.php index.html index.htm; # as directory, then fall back ..

Read more

Hello I have a laravel application behind nginx proxy pass, here’s the configuration Nginx Proxy Pass location /api { # reverse proxy for app proxy_pass http://10.104.0.2/api; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection ‘upgrade’; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect default; proxy_redirect /api $scheme://$http_host/api/; } location ..

Read more

I never seen this issues beore, I have a Laravel app. When I tried to log in, I kept seeing 404. I checked laravel.log while logging in, I see nothing. web.php Route::get(‘/’, function () { return redirect(‘login’); })->name(‘home’); Route::middleware([‘auth:sanctum’, ‘verified’])->get(‘/dashboard’, function () { return redirect(‘clients’); })->name(‘dashboard’); Live: http://192.81.216.234/login Hint: I already triple check the password, ..

Read more

I never saw this issue before, I have a Laravel app. When I tried to log in, I kept seeing 404. I checked laravel.log while logging in, I see nothing. web.php Route::get(‘/’, function () { return redirect(‘login’); })->name(‘home’); Route::middleware([‘auth:sanctum’, ‘verified’])->get(‘/dashboard’, function () { return redirect(‘clients’); })->name(‘dashboard’); Live: https://awningapp.com/login Hint: I already triple check the password, ..

Read more

Quick question, shouldn’t be too hard… hopefully. I’m running Nginx with two Laravel projects being hosted. The following directories are where they are being stored. /var/www/site.kara /var/www/site.arkmanager The location of the projects are http://10.0.0.2/kara and http://10.0.0.2/arkmanager. The site.kara laravel project is loading images just fine. However I have an issue with the site.arkmanager locating images ..

Read more

User must verify their email address so I use laravel email verification. I configured the project on Ubuntu20.04 and with nginx. Verification link works when I use let’s encrypt certificate. I followed all the steps and configured cloudflare and I followed digitalocean tutorial for adding cloudflare ssl certificate. This is the nginx configuration for domain ..

Read more

I have a Laravel project that dockerized with Nginx, PHP, MySQL, and Redis. my os is ubuntu 18.04. I want to create a virtual host for example Laravel.dev here is my docker-compose config for Nginx nginx: build: context: ./docker/nginx dockerfile: Dockerfile volumes: – ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf – ./docker/nginx/sites-available:/etc/nginx/sites-available – ./docker/nginx/sites-enabled:/etc/nginx/sites-enabled – ./:/var/www/html expose: – "80" ports: – ..

Read more