Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP files are downloaded #228

Open
sydev opened this issue Oct 29, 2019 · 0 comments
Open

PHP files are downloaded #228

sydev opened this issue Oct 29, 2019 · 0 comments

Comments

@sydev
Copy link

sydev commented Oct 29, 2019

When I want to serve PHP files, they are downloaded. When I inspected the Header of the request I saw that the Content-Type is kind of wrong: application/x-httpd-php.

After I googled a little bit about this behaviour, I found out that this causes the browser to download it. Am I doing something wrong?

Caddyfile

0.0.0.0:80 {
  root /srv
  gzip
  log ../access.log

  proxy / web:8080 {
    transparent
  }

  fastcgi / 127.0.0.1:9000 php
  on startup php-fpm7
}

docker-compose.yml

version: "3.7"
services:
  db:
    image: mysql:8
    command: --default-authentication-plugin=mysql_native_password
    restart: unless-stopped
    env_file: .env
    environment:
      MYSQL_ROOT_PASSWORD: $DATABASE_PASSWORD
      MYSQL_DATABASE: $DATABASE_NAME
      MYSQL_USER: $DATABASE_USERNAME
      MYSQL_PASSWORD: $DATABASE_PASSWORD
    volumes:
      - ./data:/var/lib/mysql
    networks:
      - comingsoon
  web:
    restart: always
    build:
      context: ./web
      dockerfile: Dockerfile.dev
    expose:
      - 8080
    volumes:
      - ./web/src:/tmp/src
    networks: 
      - comingsoon
  server:
    image: abiosoft/caddy:php
    restart: unless-stopped
    volumes:
      - './.caddy:/root/.caddy'
      - ./web/Caddyfile:/etc/Caddyfile
      - ./web/src/form.php:/srv/form.php
    ports:
      - 7020:80
    depends_on:
      - db
      - web
    networks:
      - comingsoon

networks:
  comingsoon:
    driver: bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant