Skip to content

Commit e37ace7

Browse files
committed
Move default.conf to nginx folder for Docker
1 parent 8a4608c commit e37ace7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

nginx/default.conf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
server {
2+
listen 80;
3+
server_name localhost; # Or your-domain.com if you have one
4+
5+
location / {
6+
# 'gym-api' matches the service name in docker-compose.yml
7+
# '8080' matches the internal port of your .NET app
8+
proxy_pass http://gym-api:8080;
9+
10+
# These headers are CRITICAL for the "ForwardedHeaders" logic
11+
# we added to your Program.cs to work correctly.
12+
proxy_http_version 1.1;
13+
proxy_set_header Upgrade $http_upgrade;
14+
proxy_set_header Connection keep-alive;
15+
proxy_set_header Host $host;
16+
proxy_set_header X-Real-IP $remote_addr;
17+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
18+
proxy_set_header X-Forwarded-Proto $scheme;
19+
proxy_cache_bypass $http_upgrade;
20+
}
21+
}

0 commit comments

Comments
 (0)