Sage 10 redirecting sub urls like wp-admin and /anything from localhost:3000 to proxy url

When running npm run dev the locahost:3000 (hot loading url) works fine, but if i append wp-admin or any-other-url it redirects me to the URL that its supposed to be proxying via bud.config.js

For example: https://locahost:3000/wp-admin redirects to https://wordpres-docker.test/wp-admin I also get a 200 in dev but a 400 for the proxy like so:

200 [dev] http://localhost:3000
400 [proxy] https://wordpress-docker.test

Here’s my docker-compose.yml

version: "3.9"

services:
  nginx:
    build:
      context: .
      dockerfile: nginx.dockerfile
    depends_on:
      - php
      - mysql
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./wordpress:/var/www/html:delegated
  mysql:
    image: mysql:latest
    environment:
      MYSQL_DATABASE: wp
      MYSQL_USER: wp
      MYSQL_PASSWORD: secret
      MYSQL_ROOT_PASSWORD: secret
    volumes:
      - ./mysql:/var/lib/mysql
  php:
    build:
      context: .
      dockerfile: php.dockerfile
    volumes:
      - ./wordpress:/var/www/html:delegated
  wp:
    build:
      context: .
      dockerfile: php.dockerfile
    volumes:
        - ./wordpress:/var/www/html:delegated
    entrypoint: ['wp', '--allow-root']

I am using Docker, could this be the issue? Or would it be a simple config fix somewhere? Do I need to add a bud container in docker-compose.yml ?

3 Likes

I got the same issue with Flywheel Local app. Every time I try to go to http://localhost:3000/wp-admin, it redirects me to xxx.local/wp-admin.

app.setUrl('http://localhost:3000').setProxyUrl('xxx.local').watch...