Wordpress - cURL错误7:无法连接到localhost端口80:连接被拒绝

时间:2017-08-28 12:17:01

标签: php wordpress curl docker docker-compose

我在一起运行docker和WordPress,我一直在

cURL错误7:无法连接到localhost端口80:拒绝连接

所以我的wp cronjobs不能运行。知道为什么吗?奇怪的是,如果我从functions.php运行卷曲curl就像它应该的那样工作。

搬运工-compose.yml

version: "3"

services:

  php:
    build: ./php/
    expose:
      - 9000
    volumes:
      - "${PROJECT_UROOT}:/var/www"
    working_dir: ${PROJECT_SROOT}
    networks:
      - server
      - database
    depends_on:
      - mysql

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    ports:
      - 8080:80
    networks:
      - database
    depends_on:
      - mysql
    environment:
      PMA_HOST: mysql
    restart: always

  composer:
    restart: 'no'
    image: composer/composer:php7
    command: install
    volumes:
      - "${PROJECT_UROOT}:/var/www"
    working_dir: ${PROJECT_SROOT}

  nginx:
    build: ./nginx/
    ports:
      - "80:80"
    volumes:
      - "${PROJECT_UROOT}:/var/www"
      - ./nginx/logs:/var/log/nginx
    networks:
      - server
    depends_on:
      - php
    restart: always

  mysql:
    image: mariadb
    ports:
      - '3306:3306'
    volumes:
      - ./mysql/db-data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
    restart: always
    networks:
      - database

volumes:
  data:

networks:
  database:
  server:

default.conf(这是完整的配置)

server {
    listen 80 default_server;
    root /var/www/public;
    index index.html index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log  /var/log/nginx/error.log error;

    sendfile off;

    client_max_body_size 100m;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

    location ~ /\.ht {
        deny all;
    }

}

0 个答案:

没有答案