Category : nginx

I’m using Laravel sanctum to authenticate my API, but i’m not using the default laravel User model, I’ve built a model to separate my App customers in another table called Customer. To this to work I did the alterations bellow Custom model Customer.php https://ghostbin.com/Opey3 Config file auth.php https://ghostbin.com/BsYSb Config file sanctum.php https://ghostbin.com/yDlts Route file api.php ..

Read more

I’m trying to run a Laravel application over an Nginx proxy layer provided by this package. I was able to setup the docker container following the instructions and then I have created a docker-compose.yml file which contains the following structure: version: ‘3.9’ services: laravel-fpm: container_name: laravel_app restart: always build: context: . dockerfile: ./docker/php-fpm/Dockerfile volumes: – ..

Read more

—–> Building on the Heroku-20 stack —–> Using buildpack: heroku/php —–> PHP app detected —–> Bootstrapping… —–> Installing platform packages… – php (8.1.1) – ext-mbstring (bundled with php) – composer (2.2.3) – apache (2.4.51) – nginx (1.20.2) —–> Installing dependencies… Composer version 2.2.3 2021-12-31 12:18:53 Installing dependencies from lock file Verifying lock file contents can ..

Read more

I’m usinng nginx to deploy laravel project. So, it’s the first time that I write nginx configuration for php. This is my configuration. I am getting 502 Bad Gateway with upstream prematurely closed connection while reading response header from upstream, client error. /etc/nginx/sites-enabled/teleport.conf server { listen 443 ssl default_server; listen [::]:443 ssl default_server; include snippets/snakeoil.conf; ..

Read more

I’m having a hard time to debug my Laravel app when there’s a bug in the code. Let’s say I have the route: Route::get(‘/test’, function () { return ‘it_works’; }); Everything works fine. However, if I add a bug in the code like this: Route::get(‘/test’, function () { return ‘all_good’ . $not_declared_variable; //Obviously a bug, ..

Read more

I am trying to upload a zip file from admin panel and couldnt figure out whats the problem below is the nginx error log Stack trace: #0 /var/www/app/Http/Helpers.php(625): IlluminateFoundationBootstrapHandleExceptions->handleError() #1 /var/www/storage/framework/views/72d4631affd952c4e3bee9501b68e8bee4272705.php(10): getBaseURL() #2 /var/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(107): require(‘/var/www/storag…’) #3 /var/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(108): IlluminateFilesystemFilesystem::IlluminateFilesystem{closure}() #4 /var/www/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): IlluminateFilesystemFilesystem->getRequire() #5 /var/www/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(61): IlluminateViewEnginesPhpEngine->evaluatePath() #6 /var/www/vendor/facade/ignition/src/Views/Engines/CompilerEngine.php(37): IlluminateViewEnginesCompilerEngine->get() #7 /var/www/vendor…PHP message: PHP Fatal error: Uncaught ErrorException: ..

Read more

I’m setting an Nginx proxy that forwards requests to PHP (Laravel) application, all using Docker in a Kubernetes cluster. All the application is working fine except the issue below. When I upload small files (images), it works perfectly. When I increase the uploaded file size, I get this response: <html> <head> <title>403 Forbidden</title> </head> <body> ..

Read more

I want to run multiple laravel projects in nginx in window 10. I’ve run successfully single project. However I’m unable to run other projects in the localhost. Any help is appreciated. Thanks in advance. The following works. nginx.conf file server { listen 80; server_name localhost; location / { root E:/web/nginx/html/project1/public; try_files $uri $uri/ /index.php; index ..

Read more

I’m getting an error that the laravel image intervention package always return 404 not found error every time I try to access an image via URL manipulation. The images are stored in ‘storage/app/private/images/validation’ folder this is my nginx config user www www; worker_processes auto; error_log /www/wwwlogs/nginx_error.log crit; pid /www/server/nginx/logs/nginx.pid; worker_rlimit_nofile 51200; stream { log_format tcp_format ..

Read more

i made a cors middleware and set it for all apis for preventing cors error and this is my middleware : $response = $next($request); $response->headers->set(‘Access-Control-Allow-Origin’, ‘*’); $response->headers->set(‘Access-Control-Allow-Methods’, ‘GET, POST, OPTIONS, DELETE, PATCH, PUT’); $response->headers->set(‘Access-Control-Allow-Headers’, ‘Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type’); $response->headers->set(‘Access-Control-Allow-Credentials’, ‘true’); return $response; my problem is the headers seems to work just for GET api and and on post ..

Read more

So in my localhost environment, my laravel apis are in 127.0.0.1/api/* such as 127.0.0.1/api/endpoint. Now deploying it to a server named http://api.server.com, I want to call all endpoints like this http://api.server.com/endpoint instead of http://api.server.com/api/endpoint. How do I configure this on my nginx? This is my current configuration server { listen 80; # SSL configuration # ..

Read more