Skip to content

Commit

Permalink
Fixed: reverse proxy rules
Browse files Browse the repository at this point in the history
  • Loading branch information
GPortas committed Oct 7, 2024
1 parent 454ddb4 commit da681ad
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions dev-env/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ events {}
http {
server {
listen 80;
server_name localhost;
server_name localhost;

# Default route for other URLs
location / {
proxy_pass http://dataverse:8080;
}

# https://www.keycloak.org/server/reverseproxy
# Keycloak reverse proxy for /realms
location /realms {
proxy_pass http://keycloak:9080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -17,6 +18,37 @@ http {
proxy_set_header X-Forwarded-Port $server_port;
}

# Specific route for /resources/images
location /resources/images {
proxy_pass http://dataverse:8080;
}

# Specific route for /resources/css
location /resources/css {
proxy_pass http://dataverse:8080;
}

# Specific route for /resources/js
location /resources/js {
proxy_pass http://dataverse:8080;
}

# Specific route for /resources/dev
location /resources/dev {
proxy_pass http://dataverse:8080;
}

# Specific route for /resources/fontcustom
location /resources/fontcustom {
proxy_pass http://dataverse:8080;
}

# Specific route for /resources/iqbs
location /resources/iqbs {
proxy_pass http://dataverse:8080;
}

# General route for other /resources routes, handled by Keycloak
location /resources {
proxy_pass http://keycloak:9080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -25,6 +57,7 @@ http {
proxy_set_header X-Forwarded-Port $server_port;
}

# Keycloak reverse proxy for /admin
location /admin {
proxy_pass http://keycloak:9080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -33,6 +66,7 @@ http {
proxy_set_header X-Forwarded-Port $server_port;
}

# Route for SPA frontend
location /spa {
proxy_pass http://frontend:5173;
proxy_http_version 1.1;
Expand Down

0 comments on commit da681ad

Please sign in to comment.