php容器的podman dns名称
我必须使用podman容器、nginx和php。我公开了php的9000端口,并发布了th nginx容器的80端口。现在我想在两个容器之间创建一个连接,但是在nginx配置中,我需要为php指定一个ip地址或域。 是否可以给php容器一个可以在nginx congfig中使用的名称 这是我的nginx配置文件:php容器的podman dns名称,php,linux,nginx,containers,podman,Php,Linux,Nginx,Containers,Podman,我必须使用podman容器、nginx和php。我公开了php的9000端口,并发布了th nginx容器的80端口。现在我想在两个容器之间创建一个连接,但是在nginx配置中,我需要为php指定一个ip地址或域。 是否可以给php容器一个可以在nginx congfig中使用的名称 这是我的nginx配置文件: server{ listen 80; root /usr/share/nginx/html; location / { fastcgi_pas
server{
listen 80;
root /usr/share/nginx/html;
location / {
fastcgi_pass 10.88.0.25:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
}
}
Podman像localhost一样处理pod,因此pod中的所有容器都可以通过localhost访问。我不知道nginx和php的详细信息,但我猜如果将两个容器放在同一个pod中,您可以将php容器配置为侦听localhost,即127.0.0.1,然后在nginx配置中指定localhost:9000,即127.0.0.1:9000。