37 lines
915 B
Nginx Configuration File
37 lines
915 B
Nginx Configuration File
user nginx;
|
|
worker_processes auto;
|
|
pid /var/run/nginx.pid;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
sendfile on;
|
|
keepalive_timeout 65;
|
|
gzip on;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
root /app/dist; # React app's build output
|
|
index index.html;
|
|
|
|
# Proxy API requests to the internal BFF server
|
|
location /api {
|
|
proxy_pass http://localhost:3001; # BFF server is running on port 3001
|
|
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 React app for all other requests
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|
|
}
|