Answer the question
In order to leave comments, you need to log in
How to set up nginx and php containers in kubernetes?
Good afternoon, tell me please. There is an application on Kubernetes consisting of two pods. The first is the application itself with files and dependencies, which has port 9000 open. The second is nginx, which has configmap default.conf, like this
server {
set $host_path "/var/www";
server_namelocalhost;
root $host_path;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
charset utf-8;
client_max_body_size 100M;
sendfile off;
location / {
root $host_path/web;
try_files $uri $uri/ /index.php;
index index.php;
}
location ~ \.php$ {
root $host_path/web;
set $parsed_request_uri $request_uri;
include fastcgi_params;
fastcgi_pass app:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 3000;
}
location ~* /\. {
deny all;
}
}
The error is that the site opens without css styles and js. He does not see them, although they are in the /var/www/web folder. What can be wrong?
Answer the question
In order to leave comments, you need to log in
letema ,
I have a couple of questions
1) why the section
location ~ \.php$does it look like this? Php application because in another container
proxy_pass app:9000and that's all
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question