-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
How to disable HTTPS and configure custom ports for Nginx proxy usage #692
Comments
Hi @Arthur-LDH! Make FrankenPHP are HTTP-onlyTo make FrankenPHP (Caddy) listen only to TCP port 80 (and disable auto SSL), it is enough to use Example SERVER_NAME=":80" CADDY_MERCURE_PUBLIC_URL="https://example.com/.well-known/mercure" docker compose up This value can also be written explicitly in the compose.yaml file, if this is a more convenient option (in this case, there will be no need to change other environment variables). services:
php:
image: ${IMAGES_PREFIX:-}app-php
restart: unless-stopped
environment:
- SERVER_NAME: ${SERVER_NAME:-localhost}, php:80
+ SERVER_NAME: :80
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} Use custom port for FrankenPHPTo get a container with FrankenPHP on a different port in the host, it is enough to set the value of the required port for the environment variable Example (using TCP port HTTP_PORT=8080 docker compose up Similarly to the previous one, this value can be written explicitly in the compose.yaml file (at the same time disabling unnecessary, in the context of this issue, port forwarding). services:
php:
# ...
ports:
# HTTP
- target: 80
- published: ${HTTP_PORT:-80}
+ published: 8080
protocol: tcp
- # HTTPS
- - target: 443
- published: ${HTTPS_PORT:-443}
- protocol: tcp
- # HTTP/3
- - target: 443
- published: ${HTTP3_PORT:-443}
- protocol: udp |
Current ConfigurationMy current # compose.yaml
services:
php:
image: ${IMAGES_PREFIX:-}app-php
restart: unless-stopped
environment:
# Server Configuration
SERVER_NAME: ':80'
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
TRUSTED_PROXIES: ${TRUSTED_PROXIES:-127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16}
TRUSTED_HOSTS: ^${SERVER_NAME:-example\.com|localhost}|php$$
DATABASE_URL: mysql://${MYSQL_USER:-app}:${MYSQL_PASSWORD:-!ChangeMe!}@database:3306/${MYSQL_DATABASE:-app}?serverVersion=${MARIADB_VERSION:-11.2.2}&charset=${MYSQL_CHARSET:-utf8mb4}
MERCURE_URL: https://${SERVER_NAME:-localhost}/.well-known/mercure
MERCURE_PUBLIC_URL: https://${SERVER_NAME:-localhost}/.well-known/mercure
MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
SYMFONY_VERSION: ${SYMFONY_VERSION:-}
STABILITY: ${STABILITY:-stable}
volumes:
- caddy_data:/data
- caddy_config:/config
- app_data:/app
ports:
# HTTP
- target: 80
published: 80
protocol: tcp
# HTTPS (Commented)
#- target: 443
# published: ${HTTPS_PORT:-443}
# protocol: tcp
# HTTP/3 (Commented)
#- target: 443
# published: ${HTTP3_PORT:-443}
# protocol: udp Despite having HTTPS and HTTP/3 ports commented out in the configuration,
|
Thanks for detailed information, @Arthur-LDH! The The information
See also: |
You can see also : #451 With all these resources, you should find the answer to your needs. |
I'm trying to configure FrankenPHP/Caddy to work behind an Nginx proxy server to host multiple Docker projects on a single server.
Current issue:
Thanks !
The text was updated successfully, but these errors were encountered: