From 8781d22acf2fc8c519da6b4f81446897277b3721 Mon Sep 17 00:00:00 2001 From: Tatiana Villa Ema Date: Mon, 27 Apr 2026 02:09:57 +0200 Subject: [PATCH] feat: add nginx.conf for frontend proxy to API --- frontend/nginx.conf | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 frontend/nginx.conf diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..7586d7d --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,21 @@ +server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + # Proxy API calls to the Spring Boot backend + location /f1/ { + proxy_pass http://formula1-api:8080/f1/; + 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; + } + + # Serve static files + location / { + try_files $uri $uri/ /index.html; + } +}