Skip to content

PrestaShop in Docker redirects to localhost:8080 instead of configured domain #395

@sepiropht

Description

@sepiropht

Description

I'm experiencing an issue where my PrestaShop setup redirects the domain to localhost:8080 when i use browser instead of the actual domain set for my shop.

Steps to Reproduce

Use ubuntu 22.04

  1. Set up PrestaShop in a Docker container.
  2. Use Caddy as the web server.
  3. Access https://shop.mydomain.com.

Expected Behavior

The shop should open correctly without redirecting to localhost:8080.

Actual Behavior

The shop redirects to localhost:8080, causing a failed page load.

My Caddyfile

shop.mydomain.com {
  reverse_proxy localhost:8080
}

I use the docker compose file from the doc

version: '3'

services:
  mariadb:
    container_name: prestashop-db
    image: mariadb:10.5
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: admin
      MYSQL_DATABASE: prestashop
    volumes:
      - ./mariadb_data:/var/lib/mysql
      - ./my.cnf:/etc/mysql/my.cnf
    networks:
      - prestashop_network
    deploy:
      resources:
        limits:
          memory: 1G

  prestashop:
    container_name: prestashop
    image: prestashop/prestashop:latest
    restart: unless-stopped
    depends_on:
      - mariadb
    ports:
      - "8080:80"
    environment:
      DB_SERVER: prestashop-db
      DB_NAME: prestashop
      DB_USER: root
      DB_PASSWD: admin
      PS_INSTALL_AUTO: 1
      ## there i  also tried my own domain but doesnt' work too but. The doc seems to recommand localhost:8080
      PS_DOMAIN: localhost:8080
    volumes:
      - ./prestashop_data:/var/www/html
    networks:
      - prestashop_network

networks:
  prestashop_network:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions