For my client I’m working on BRXM 14.1 with headless setup. Locally everything is running with Apache as reverse proxy, using the default setup (configuration as described here).
Issue description:
However, for our DTAP servers we want to use Docker & Nginx. As we couldn’t get that working out of the box, we are now locally trying to fix this. We can’t get our BR Docker setup, in combination with Nginx, working for CMS. Docker, Nginx & Site combination is working.
Config
We have a default Nginx container with configuration as below and Bloomreacht container with hst:host definitions as below. Here are the most important details of this configuration:
We have been playing with properties hst:defaultport, hst:showcontextpath and hst:showport but nothing seems to work.
If anyone has the answer I would love to hear it. Maybe it is something simple we are overlooking?
Nginx configuration CMS
server {
listen 80;
server_name "cms.local.issues.nl";
location / {
# Set headers for proxy header rewriting, like ProxyPassReverse in Apache http
# See http://wiki.nginx.org/LikeApache
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://brxm:8080/cms/;
proxy_redirect / http://brxm:8080/cms/;
#proxy_redirect default;
proxy_cookie_path /cms/ /;
}
}
Nginx configuration SITE
server {
listen 80;
server_name "brxm.local.issues.nl";
location / {
# Set headers for proxy header rewriting, like ProxyPassReverse in Apache http
# See http://wiki.nginx.org/LikeApache
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://brxm:8080/site/;
proxy_redirect default;
proxy_cookie_path /site/ /;
}
}
Docker compose file
version: '3.7'
services:
nginx:
image: nginx:stable-alpine
hostname: 'nginx'
networks:
brxm_net:
aliases:
- "cms.local.issues.nl"
- "brxm.local.issues.nl"
- "frontend.local.issues.nl"
ports:
- 10080:80
- 10443:443
links:
- frontend
- brxm
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/conf.d:/etc/nginx/conf.d
frontend:
image: docker-server:5000/frontend:latest
hostname: 'frontend'
links:
- brxm
networks:
brxm_net:
ports:
- 3000:3000
brxm:
image: docker-server:5000/brxm:latest
hostname: 'brxm'
ports:
- 8080:8080
- 8009:8009
networks:
brxm_net:
environment:
profile: h2
volumes:
- ./tomcat/conf:/usr/local/tomcat/conf
networks:
brxm_net:
BR hst:host configuration for Site
/hst:myproject/hst:hosts/brxm-local-issues-nl:
jcr:primaryType: hst:virtualhostgroup
hst:defaultport: 8080
/nl:
jcr:primaryType: hst:virtualhost
hst:showcontextpath: false
hst:showport: true
/issues:
jcr:primaryType: hst:virtualhost
/local:
jcr:primaryType: hst:virtualhost
/brxm:
jcr:primaryType: hst:virtualhost
/hst:root:
jcr:primaryType: hst:mount
hst:alias: Particulier
hst:homepage: root
hst:locale: nl_NL
hst:mountpoint: /hst:myproject/hst:sites/particulier
hst:pagemodelapi: resourceapi
hst:parameternames: [environment]
hst:parametervalues: [local-docker]
hst:responseheaders: ['Access-Control-Allow-Origin: http://localhost:3000','Access-Control-Allow-Credentials: true']
BR hst:host configuration for Site
/hst:platform/hst:hosts/cms-local-issues-nl:
jcr:primaryType: hst:virtualhostgroup
hst:defaultport: 8080
/nl:
jcr:primaryType: hst:virtualhost
hst:showcontextpath: false
hst:showport: true
/issues:
jcr:primaryType: hst:virtualhost
/local:
jcr:primaryType: hst:virtualhost
/cms:
jcr:primaryType: hst:virtualhost
/hst:root:
jcr:primaryType: hst:mount
hst:ismapped: false
hst:namedpipeline: WebApplicationInvokingPipeline
hst:showcontextpath: false
hst:showport: false