Похожие чаты

Hi guys! I have an NGINX installed on my CentOS and

I have a laravel app running with php-fpm on docker. I use fastcgi_proxy to pass requests to the fpm container. When I build some frontend, my static files(css, js, photos) that are saved under the public directory, are not loading. Laravel returns 404(it's not nginx's 404) what's the solution?

p.s: my laravel app is mounted using a volume. All of the access rights are the same and the APIs are working correctly. Just asset files are failing.

Thanks in advance

9 ответов

10 просмотров

How are you trying to access the static files

If it’s in public folder as a static asset you can call it directly of course. You need a directive for static files in nginx There’s many articles for that. Check this one for Wordpress https://wordpress.org/support/article/nginx/

Peyman EhsanDoost
still the same...

I would remove laravel completely and see if it serves static assets like jpg or txt

Peyman-EhsanDoost Автор вопроса
Lalo
I would remove laravel completely and see if it se...

Laravel is behind a "fastcgi_proxy" and it's inside a fpm docker container. Nginx is on the OS itself. It's laravel giving the 404 not Nginx.

Peyman EhsanDoost
Laravel is behind a "fastcgi_proxy" and it's insid...

Static assets are not supposed to be served by laravel Instead, nginx serving them directly from public folder

Peyman EhsanDoost
Laravel is behind a "fastcgi_proxy" and it's insid...

Think about it. All laravel knows is what’s in its routes Public assets don’t exist for laravel When you run locally, your php server does serve static assets In production, it’s nginx job to serve static assets

Peyman-EhsanDoost Автор вопроса
Lalo
Think about it. All laravel knows is what’s in it...

Ok so I'll have to write some location block to resolve the assets from the mounted volume?

Peyman EhsanDoost
Ok so I'll have to write some location block to re...

Yeah I guess this is a question for docker expert I guess (I’m not)

Похожие вопросы

Обсуждают сегодня

А чем вам питонисты не угодили?😂
.
79
всем доброго времени суток! имею вопрос: как понять ТОЧНО, что на нексус производится атака или он перегружен? исходные данные: - Nexus OSS 3.67.1-01 на OrientDB - Total co...
Michael Kostelcev
11
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
75
or any website to buy prepaid card with xmr that's not trocador that's down?
Umbrella Party Partner
18
Hi, I can't understand promises in JavaScript and what we should use them for (maybe the teacher didn't teach well XD). Do you have a solution for this? And are promises used...
A
29
Ещё такой вопрос. Мне необходимо хранить пароль пользователя локально. Для этого планирую использовать ini файл. Это для автозаполнения полей логин и пароль при авторизации. Е...
Евгений
19
Добрый день, LO Writer, проблема с нумерацией таблиц (вставка названия). У меня два стиля нумерованных списка, один для основного текста (вида 1.1.1) другой доя приложений (ви...
Виктор
6
My assets the Oceans at Binance, its displaying passive and no automatically convert, this situation will change?
Nationalizze
8
Xem delist ho rha hai agr naa bhechu toh kya hoga after 1 july?
ABHI
27
Ты просто гитлеровскую эстетику плохо понимаешь. Он же всё под Цезаря делал. А это как бы запрещённый приём в политике. Пиджаки они зачем все носят? Чтобы показать что они тип...
Ivan Kropotkin
4
Карта сайта