Category : nginx

I am using elasticbeanstalk for Laravel API and ec2 for nextjs frontend. The issue is with authorization header. From localhost authorization header is working fine. But from ec2 server authorization header is not attaching. Nginx is running on elasticeanstalk. Is there any solution? Localhost header: { "accept-language": "en-GB,en-US;q=0.9,en;q=0.8", "accept-encoding": "gzip, deflate", "referer": "http://localhost:81/", "origin": "http://localhost:81", ..

Read more

I am using Laravel-8 framework as Restful API server, and Nextjs as client render. I created two folders: /var/www/domain/backend (Laravel 8 app) /var/www/domain/frontend (Nextjs app) To run nextjs app I am using pm2. (npm run build then pm2 start). I have two nginx configuration files: /etc/nginx/conf.d/frontend.conf /etc/nginx/conf.d/backend.conf Before production frontend run in port 3000 and ..

Read more

All routes on my production website are working fine except for the /blog route which gives a 403 forbidden (nginx). In web.php Route::get(‘/blog’, [BlogController::class, ‘index’])->name(‘blog.index’); Route::get(‘/blog/{slug}’, [BlogController::class, ‘post’])->name(‘blog.post’); Route::get(‘/blog/preview/{slug}’, [BlogController::class, ‘postPreview’])->name(‘blog.post.preview’); I have deployed via Forge and Envoyer and didn’t change anything in the server configs. Sourc..

Read more

I seem to have cors configured properly in Laravel, yet my frontend never get response with the ‘Access-Control-Allow-Origin’ header. frontend is on localhost:3000 and the backend is localhost:8080. The page that I’m sending POST from is localhost:3000/register. The backend route is localhost:8080/api/register. This is the cors.php file: ‘paths’ => [‘api/*’, ‘sanctum/csrf-cookie’], ‘allowed_methods’ => [‘*’], ‘allowed_origins’ ..

Read more

I can’t figure out where the issue stems from. I have a registration page for a new user at localhost:3000/register. It calls the backend Laravel Sanctum API at localhost:8080/api/register. Everything is set correctly in the Laravel configuration. The user even registers to the database, yet I still get this error: Access to XMLHttpRequest at ‘http://localhost:8080/api/register’ ..

Read more

I’ve been on this issue for a few days now, and no solution yet. I am running 4 Docker containers: Nginx PHP-FPM for the Laravel backend API Node for the Next.js (React) frontend MySQL The frontend is served from localhost and the backend from localhost:8080 I tried for days to figure out why Sanctum won’t ..

Read more

I made an app with laravel and nuxt. I deployed it to server with nginx. My nginx code is like this server { listen 80; root /home/anjaan/desijewel/api/public; index index.php index.html index.htm index.nginx-debian.html; server_name 206.189.142.151; location /api { try_files $uri $uri/ /index.php?$query_string; } location / { // Reverse proxy code from nuxtjs.org } location ~ .php$ ..

Read more

i have problem with installing and using my Laravel-swagger package on Laravel 5.5 and docker with nginx configuration. The problem is that when i’m trying to load my host page with installed swagger like https://127.0.0.1:8080/api/documentation it loads me empty screen because of all my styles loads without port usage like: http://127.0.0.1/docs/asset/swagger-ui.css?v=1f524b0bbfd05a62b996252847139c9d enter image description here ..

Read more

I’m trying to make a Laravel project image(for local using at first) with the docker-compose. So, I made the following files: docker-compose.yml: version: ‘3.9’ networks: laravel: services: nginx: build: context: . dockerfile: docker/nginx/Dockerfile container_name: nginx ports: – 8020:80 volumes: – ./:/var/www/swdocker depends_on: – php – mysql networks: – laravel mysql: image: mysql container_name: mysql restart: ..

Read more

I face with strnge behavour and did not understand what need to fix, I have latavel with nginx and by some reason faced with 404 Not Found so, my docker compose version: ‘3.7’ services: nginx-laratest: build: context: . dockerfile: ./nginx/Dockerfile restart: on-failure volumes: – "../:/var/www" ports: – "80:80" – "443:443" depends_on: – php-laratest networks: – ..

Read more

Hi I would like to know how to migrate my apache2 .htaccess rules to nginx here is my .htaccess code RewriteEngine On RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^ ^$1 [N] RewriteCond %{REQUEST_URI} (.w+$) [NC] RewriteRule ^(.*)$ public/$1 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ server.php Sourc..

Read more

Hi I would like to know how to migrate my apache2 .htaccess rules to nginx here is my .htaccess code RewriteEngine On RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^ ^$1 [N] RewriteCond %{REQUEST_URI} (.w+$) [NC] RewriteRule ^(.*)$ public/$1 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ server.php Sourc..

Read more

I was trying deploy laravel with nginx on Ubuntu 20.04. I’ve modified the /etc/nginx/sites-available/default and when I tried to restart the nginx service i encountered this problem. $ sudo systemctl restart nginx Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. $ journalctl ..

Read more

We have Nginx and using it to serve a Laravel 8 project I have the need to protect with a basic auth this demo project. it works, using nginx and auth_basic_file directive auth_basic "My DEMO"; location ~ ^/(api|public|images)/.* { auth_basic off; try_files $uri $uri/ /index.php?$query_string; } location ~ .php$ { # Protect access auth_basic_user_file /etc/nginx/auth/.htpasswd; ..

Read more