1
我试图将nginx.conf和docker-compose.yml中的端口号更改为9001而不是9000.但是,当我运行docker-compose时,它显示502 Bad Gateway。这是为什么?我锁定只能使用端口9000吗?docker nginx 502坏的网关
nginx.conf
location /index.php {
include fastcgi_params;
fastcgi_connect_timeout 10s;
fastcgi_read_timeout 10s;
fastcgi_buffers 256 4k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php:9000; <-- Changing this to 9001
}
泊坞窗,compose.yml
php:
build: images/php
volumes:
- ./images/php/app:/app
working_dir: /app/public
command: php-fpm
links:
- db
- cache
ports:
- "9000:9000" <-- Changing this to "9001:9001"