Skip to content

Commit

Permalink
use nginx as revers proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Unischneider committed Oct 27, 2024
1 parent 49ba444 commit 12289b2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
services:
nginx:
image: nginx:alpine
container_name: nginx
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- angelos-ui
networks:
- angelos-network

angelos-ui:
image: "ghcr.io/ls1intum/angelos-ui:latest"
ports:
Expand Down
27 changes: 18 additions & 9 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
server {

listen 80;

location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}

# Proxy API requests to the backend service (angelos-app)
location /api/ {
proxy_pass http://angelos-app:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

error_page 500 502 503 504 /50x.html;

location = /50x.html {
root /usr/share/nginx/html;
}
location = /50x.html {
root /usr/share/nginx/html;
}

}
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const environment = {
production: true,
angelosUrl: 'http://angelos-app:8000/api/v1/question/chat'
angelosUrl: '/api/v1/question/chat'
};

0 comments on commit 12289b2

Please sign in to comment.