Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ services:
FPM_ROOT: $PWD/pub
MAGE_RUN_TYPE: store #or set to website
command: /bin/sh -c "envsubst '$$MAGE_RUN_TYPE $$FPM_PORT $$FPM_XDEBUG $$FPM_ROOT $$FPM_ROOT_ABS' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
extra_hosts:
- "host.docker.internal:host-gateway"

# Uncomment the ngrok service to expose your local environment online through ngrok
# Adding your authtoken will grant you access to more features and longer session times.
Expand Down
17 changes: 15 additions & 2 deletions nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
resolver 127.0.0.11 ipv6=off;

# Define upstreams.
# These resolve at STARTUP, so they will read the /etc/hosts file
# generated by 'extra_hosts' on Linux.
upstream php_normal {
server host.docker.internal:${FPM_PORT};
}

upstream php_debug {
server host.docker.internal:${FPM_XDEBUG};
}

# Map the cookie to the UPSTREAM NAME, not the hostname
map $cookie_XDEBUG_SESSION $phpfpm_backend {
"" host.docker.internal:${FPM_PORT};
default host.docker.internal:${FPM_XDEBUG};
"" php_normal;
default php_debug;
}

server {
Expand Down