Dockerfiles
Dockerfiles copied to clipboard
Cannot access both akeneo and akeneo-behat containers at the same time
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.
A very simple solution to this problem is to use a reverse proxy on the host machine. This should be added to the documentation.
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;
}