# Single PHP Container for Subdomain (PHP without NginxX/Apache

**URL:** https://community.traefik.io/t/single-php-container-for-subdomain-php-without-nginxx-apache/10080
**Category:** Traefik v2
**Tags:** docker
**Created:** [March 16, 2021, 5:45pm UTC](https://community.traefik.io/t/single-php-container-for-subdomain-php-without-nginxx-apache/10080 "2021-03-16T17:45:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Amlor](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/amlor/32/3551_2.png) [@Amlor](https://community.traefik.io/u/Amlor)
#### Post date: [March 16, 2021, 5:45pm UTC](https://community.traefik.io/t/single-php-container-for-subdomain-php-without-nginxx-apache/10080/1 "2021-03-16T17:45:41Z")

</div>

Hi Folks,

I've got a relatively simple docker-compose file starting a PHP Container. This container has some traefik-labels to route this for a certain sub.domain.tld (ok, with a HTTP -\> HTTPS Redirect). At this point, I've got a 404 (yes, you might have a look, nothing to hide there… so URI is within the code).  
Is it possible to always route to an index.php in a container?

```auto
version: '3.8'

services:

  php-fpm:
    image: library/php:8.0.3-fpm-alpine
    container_name: php_fpm
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - proxy
    user: "1000:1000"
    environment:
      APPLICATION_ENV: live
      APPLICATION_TAG: ${TAG:-latest}
    volumes:
      - /var/www/ipa/public:/app:rw
      - ./php-fpm/app.fpm-pool.conf:/usr/local/etc/php-fpm.d/x-app.conf:ro
      - ./php-fpm/php.ini:/usr/local/etc/php/conf.d/99-php_settings.ini
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.ipa.entrypoints=http"
      - "traefik.http.routers.ipa.rule=Host(`ipa.dulldaydudes.de`)"
      - "traefik.http.middlewares.ipa-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.ipa.middlewares=https-redirect@file"
      - "traefik.http.routers.ipa-secure.entrypoints=https"
      - "traefik.http.routers.ipa-secure.rule=Host(`ipa.dulldaydudes.de`)"
      - "traefik.http.routers.ipa-secure.tls=true"
      - "traefik.http.routers.ipa-secure.tls.certresolver=http"
      - "traefik.http.routers.ipa-secure.service=ipa"
      - "traefik.docker.network=proxy"
    expose:
      - "80"

networks:
  proxy:
    external: true

```
