Open luxarbt opened 5 years ago
Hi, @allrib.
Could you please provide some steps in order to reproduce the issue?
Regards, Alejandro
Hi @alemorcuq
I followed step by step this tutorial : https://docs.bitnami.com/kubernetes/how-to/deploy-php-application-kubernetes-helm/ .
When I attach a simple css file like that in php file :
My PHP file is 200 OK. My CSS, JS are in 404 error.
Regards, Alexis
Hi, @allrib,
In which step of the tutorial does it happen? Are you building the docker image again after attaching your files?
@alemorcuq
The problem is at the end of tutorials,
I did docker build . -t MYUSERNAME/phpfpm-app:0.1.0
in tutorials/phpfpm-k8s/
after attaching my files
and I launched helm install --set mariadb.mariadbRootPassword=DB_ROOTPASSWORD,mariadb.mariadbUser=DB_USERNAME,mariadb.mariadbPassword=DB_USERPASSWORD,mariadb.mariadbDatabase=DB_NAME --name phpfpm .
When I go to http://IP:PORT I get for example version.php 200 OK and test.css, test.js error 404
@alemorcuq
Another problem I think : css, jss files are finally served as text/html. Even though I obtain an error 200 on my statics files, they are interpreted as text/html. Can you take a look on that ?
Regards,
Alexis
Hi, @allrib.
Static files need to be mounted to the nginx
container and not to the php-fpm
one. If you look at the nginx.conf
. Looking at the nginx.conf
file:
server {
listen 0.0.0.0:80;
server_name myapp.com;
root /app;
location / {
index index.php;
}
location ~ \.php$ {
# fastcgi_pass [PHP_FPM_LINK_NAME]:9000;
fastcgi_pass phpfpm:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}
You will have to mount your static files to the /app
directory of your nginx container.
You will have to mount your static files to the
/app
directory of your nginx container.
@alemorcuq Any idea how to do that?
You will have to mount your static files to the
/app
directory of your nginx container.@alemorcuq Any idea how to do that?
How are you deploying Nginx?
helm install --set mariadb.mariadbRootPassword=DB_ROOTPASSWORD,mariadb.mariadbUser=DB_USERNAME,mariadb.mariadbPassword=DB_USERPASSWORD,mariadb.mariadbDatabase=DB_NAME --name phpfpm .
when i enter this command it give me the following error
Error:unknown flag --name
--name
is not a valid flag in Helm 3, if you are using Helm 3 you don't need to use this flag, only provide the chart name:
▶ helm2 install .
▶ helm3 install --generated-name .
▶ helm2 install --name phpfpm .
▶ helm3 install phpfpm .
Can't access to static files, every files are in 404 and served as text/html