akeneo / Dockerfiles

DEPRECATED for PIM 4.0 and above - Official Dockerfiles for Akeneo development and testing
https://hub.docker.com/r/akeneo/
MIT License
49 stars 34 forks source link

Cannot access both akeneo and akeneo-behat containers at the same time #67

Open damien-carcel opened 7 years ago

damien-carcel commented 7 years ago
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Affected image and tag new one

When running both akeneo and akeneo-behat environments through one compose file (akeneo on localhost:8080 and akeneo-behat on 8081), when a user logs in one environment, he/she is disconnected from the other one.

The problem is observed with both Apache + mod_php and Apache (FCGI) + FPM

Solution

The easiest way to handle this is to use a reverse proxy on the host machine. This should be documented.

Example with Apache, assuming the Docker container is mapped on port 8080 and we want to redirect it on the domain name pim-ce.local:

<VirtualHost *:80>
    ServerName pim-ce.local

    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>

We could also use Traefik.

damien-carcel commented 7 years ago

A very simple solution to this problem is to use a reverse proxy on the host machine. This should be added to the documentation.

damien-carcel commented 7 years ago
server {
    listen 80;
    server_name domain.local;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    access_log  /var/log/nginx/domain.access.log combined;
    error_log   /var/log/nginx/domain.error.log;
}