Skip to content

Commit

Permalink
fix: nginx config for gateway service (#1275)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgacsal committed Feb 14, 2024
1 parent fe7af63 commit 0b02e81
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 32 deletions.
2 changes: 1 addition & 1 deletion installation/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ services:
- "8080:80"
configs:
- source: gateway_config
target: /etc/nginx/nginx.conf
target: /etc/nginx/conf.d/default.conf
deploy:
mode: replicated
replicas: 1
Expand Down
56 changes: 25 additions & 31 deletions installation/docker/gateway.conf
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
events {
worker_connections 1024;
upstream ui {
server ui:80;
}

http {
upstream ui {
server ui:80;
}

upstream uibackend {
server uibackend:8890;
}
upstream uibackend {
server uibackend:8890;
}

upstream apiserver {
server apiserver:8888;
}
upstream apiserver {
server apiserver:8888;
}

server {
listen 80;
absolute_redirect off;
server {
listen 80;
absolute_redirect off;

location / {
proxy_pass http://ui/;
}
location / {
proxy_pass http://ui/;
}

location /ui/api/ {
proxy_pass http://uibackend/;
}
location /ui/api/ {
proxy_pass http://uibackend/;
}

location /api/ {
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Prefix /api;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://apiserver/;
}
location /api/ {
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Prefix /api;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://apiserver/;
}

location /apidocs/ {
proxy_pass http://swagger-ui:8080/;
}
location /apidocs/ {
proxy_pass http://swagger-ui:8080/;
}
}

0 comments on commit 0b02e81

Please sign in to comment.