Configuration of redirections
Configure nginx to route requests to Gateway, Auth and Frontend, including WebSocket traffic and proxy headers.
Configure routing in the server block of nginx.conf. The built-in reverse proxy has 4 location blocks:
location /api/ {
proxy_pass http://gateway/api/;
include common_location.conf;
}
location /livereloadHub {
proxy_pass http://gateway/livereloadHub;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location ~* ^/(idp|connect|\.well-known|Account|external) {
proxy_pass http://auth;
include common_location.conf;
}
location / {
proxy_pass http://frontend;
include common_location.conf;
}
The first block routes requests under https://domain.name/api/ to Gateway.
The second block routes https://domain.name/livereloadHub to Gateway and enables WebSocket communication.
The third block routes requests to Auth, including the login page, OpenID Connect and static resources used by the login page.
The last block routes all other requests to Frontend.
The common_location.conf file defines proxy headers, including X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Host and X-Forwarded-Port.