【发布时间】:2017-02-03 00:38:42
【问题描述】:
我试图将 nginx.conf 和 docker-compose.yml 中的端口号更改为 9001 而不是 9000。但是,当我运行 docker-compose up 时,它显示 502 Bad Gateway。这是为什么?我是否被锁定只能使用端口 9000?
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
}
docker-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"
【问题讨论】: