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"