Skip to content

Commit

Permalink
update nginx to handle both docker and podman and updated cypress yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Øvrelid committed Feb 2, 2024
1 parent b9491c6 commit eae88cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/run-cypress-on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
echo POSTGRES_PASSWORD=kyeDIG@eip >> .env
echo COMMIT= >> .env
echo IGNORE_DOCKER_DNS_LOOKUP=true >> .env
echo $CONTAINER_MANAGER_TOOL=docker >> .env
- name: Build all images
run: |
Expand Down
21 changes: 13 additions & 8 deletions development/load-balancer/nginx.conf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,18 @@ http {

rewrite ^/.*/.*/staticfiles(.*)$ $1 last;

map $container_manager_tool $container_proxy_pass_host {
default host.docker.internal;
podman host.podman.internal;
}

location ^~ /designer/frontend/dashboard/ {
proxy_redirect off;
proxy_set_header Host $host;
if ($dev_dashboard) {
add_header X-Dashboard-Source webpackDash;
rewrite /designer/frontend/dashboard/(.*) /$1 break;
proxy_pass http://host.podman.internal:2003;
proxy_pass $container_proxy_pass_host:2003;
}

if ($dev_dashboard != 1) {
Expand All @@ -77,7 +82,7 @@ http {
if ($dev_app_development) {
add_header X-Dashboard-Source webpackAppDev;
rewrite /designer/frontend/app-development/(.*) /$1 break;
proxy_pass http://host.podman.internal:2004;
proxy_pass $container_proxy_pass_host:2004;
}
if ($dev_app_development != 1) {
add_header X-Dashboard-Source dockerAppDev;
Expand All @@ -92,7 +97,7 @@ http {
if ($dev_resource_admin) {
add_header X-Dashboard-Source webpackAppDev;
rewrite /designer/frontend/resourceadm/(.*) /$1 break;
proxy_pass http://host.podman.internal:2023;
proxy_pass $container_proxy_pass_host:2023;
}
if ($dev_resource_admin != 1) {
add_header X-Dashboard-Source dockerAppDev;
Expand All @@ -106,7 +111,7 @@ http {
if ($dev_app_preview) {
add_header X-Dashboard-Source webpackAppDev;
rewrite /designer/frontend/app-preview/(.*) /$1 break;
proxy_pass http://host.podman.internal:2005;
proxy_pass $container_proxy_pass_host:2005;
}
if ($dev_app_preview != 1) {
add_header X-Dashboard-Source dockerAppDev;
Expand All @@ -120,7 +125,7 @@ http {
if ($dev_studio_root) {
add_header X-Dashboard-Source webpackDash;
rewrite /designer/frontend/studio-root/(.*) /$1 break;
proxy_pass http://host.podman.internal:2002;
proxy_pass $container_proxy_pass_host:2002;
}
if ($dev_studio_root != 1) {
add_header X-Dashboard-Source dockerDash;
Expand All @@ -135,7 +140,7 @@ http {
proxy_set_header Host $host;
if ($dev_backend) {
add_header X-Dashboard-Source dotnetPaths;
proxy_pass http://host.podman.internal:5000;
proxy_pass $container_proxy_pass_host:5000;
}
if ($dev_backend != 1) {
add_header X-Dashboard-Source dockerPaths;
Expand All @@ -158,7 +163,7 @@ http {
proxy_set_header Host $host;
if ($dev_backend) {
add_header X-Dashboard-Source dotnetPaths;
proxy_pass http://host.podman.internal:5000;
proxy_pass $container_proxy_pass_host:5000;
}
if ($dev_backend != 1) {
add_header X-Dashboard-Source dockerPaths;
Expand All @@ -169,7 +174,7 @@ http {
location / {
if ($dev_backend) {
add_header X-Dashboard-Source dotnetRoot;
proxy_pass http://host.podman.internal:5000;
proxy_pass $container_proxy_pass_host:5000;
}
if ($dev_backend != 1) {
add_header X-Dashboard-Source dockerRoot;
Expand Down

0 comments on commit eae88cb

Please sign in to comment.