You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用TYPO3 Docker Boilerplate+Dinghy遇502错误,未装Nginx却现Nginx报错

Troubleshooting 502 Bad Gateway with TYPO3 Docker Boilerplate (Apache) & Dinghy

Hey there, let's break down why you're seeing that Nginx 502 error even though you opted for Apache in your TYPO3 container. Here's what's going on and how to fix it:

Why is Nginx showing up in the error?

Dinghy uses its own built-in Nginx instance as a reverse proxy to route local requests to your Docker containers. That's why the error references Nginx—it's the proxy layer sitting between your machine and your Apache container. A 502 means Dinghy's Nginx can't establish a successful connection to your Apache app container.

Step-by-Step Fixes

  • Check if your Apache container is running properly
    First, confirm your app container is up and healthy:

    docker-compose ps
    

    If it's not in an Up state, start it and check logs for Apache startup issues:

    docker-compose up -d app
    docker-compose logs app
    

    Look for errors like Apache failing to bind to port 80, missing config files, or permission-related issues.

  • Confirm VIRTUAL_PORT matches Apache's listening port
    Your docker-compose.yml sets VIRTUAL_PORT=80—make sure Apache inside the container is actually listening on port 80. Jump into the container to verify:

    docker exec -it <your-app-container-name> bash
    # Inside the container, run:
    netstat -tulpn | grep 80
    

    If Apache is listening on a different port (like 8080), update the VIRTUAL_PORT value in docker-compose.yml to match, then restart the container.

  • Verify Dinghy's Nginx proxy configuration
    Dinghy auto-generates Nginx configs based on your VIRTUAL_HOST setting. Check if the config points to the right container and port:

    docker exec -it dinghy-nginx cat /etc/nginx/conf.d/typo3.docker.conf
    

    Look for a line like proxy_pass http://app:80;—it should reference your app service name and correct port. If the config is incorrect, restart Dinghy's Nginx container to regenerate it:

    docker restart dinghy-nginx
    
  • Test network connectivity between Dinghy Nginx and your Apache container
    Make sure the proxy can reach your app container. From the Dinghy Nginx container, try pinging and connecting to the app port:

    # Ping the app container (uses Docker service name)
    docker exec -it dinghy-nginx ping app
    # Test port 80 connectivity
    docker exec -it dinghy-nginx telnet app 80
    

    If the ping or telnet fails, your containers might not be on the same Docker network. Double-check that your docker-compose.yml uses the default network or a network accessible to Dinghy.

Your Provided Configurations

For reference, here's the configuration you shared:

Dockerfile.development

FROM webdevops/php-apache-dev:ubuntu-14.04
ENV PROVISION_CONTEXT "development"
# Deploy scripts/configurations
COPY etc/ /opt/docker/etc/
RUN ln -sf /opt/docker/etc/cron/crontab /etc/cron.d/docker-boilerplate \
    && chmod 0644 /opt/docker/etc/cron/crontab \
    && echo >> /opt/docker/etc/cron/crontab \
    && ln -sf /opt/docker/etc/php/development.ini /opt/docker/etc/php/php.ini
# Configure volume/workdir
WORKDIR /app/

docker-compose.yml (relevant section)

...
app:
  build:
    context: .
    dockerfile: Dockerfile.development
...
  environment:
    - VIRTUAL_HOST=.typo3.docker
    - VIRTUAL_PORT=80
    - POSTFIX_RELAYHOST=[mail]:1025
...

内容的提问来源于stack exchange,提问作者Andrei Todorut

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:53:45