|
1 | | -server { |
2 | | - listen 80; |
3 | | - server_name localhost; |
4 | | - root /usr/share/nginx/html; |
5 | | - index index.html; |
6 | | - |
7 | | - # Gzip compression |
8 | | - gzip on; |
9 | | - gzip_vary on; |
10 | | - gzip_min_length 1024; |
11 | | - gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/json; |
12 | | - |
13 | | - # SPA routing - serve index.html for all routes |
14 | | - location / { |
15 | | - try_files $uri $uri/ /index.html; |
16 | | - } |
17 | | - |
18 | | - # API proxy to backend service (set BACKEND_UPSTREAM at runtime) |
19 | | - location /api { |
20 | | - proxy_pass http://${BACKEND_UPSTREAM}; |
21 | | - proxy_http_version 1.1; |
22 | | - proxy_set_header Upgrade $http_upgrade; |
23 | | - proxy_set_header Connection 'upgrade'; |
24 | | - proxy_set_header Host $host; |
25 | | - proxy_cache_bypass $http_upgrade; |
26 | | - proxy_set_header X-Real-IP $remote_addr; |
27 | | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
28 | | - proxy_set_header X-Forwarded-Proto $scheme; |
29 | | - } |
30 | | - |
31 | | - # Docker registry API proxy |
32 | | - location /v2 { |
33 | | - proxy_pass http://${BACKEND_UPSTREAM}; |
34 | | - proxy_http_version 1.1; |
35 | | - proxy_set_header Upgrade $http_upgrade; |
36 | | - proxy_set_header Connection 'upgrade'; |
37 | | - proxy_set_header Host $host; |
38 | | - proxy_cache_bypass $http_upgrade; |
39 | | - proxy_set_header X-Real-IP $remote_addr; |
40 | | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
41 | | - proxy_set_header X-Forwarded-Proto $scheme; |
42 | | - } |
43 | | -} |
44 | | - |
| 1 | +server { |
| 2 | + listen 80; |
| 3 | + server_name localhost; |
| 4 | + root /usr/share/nginx/html; |
| 5 | + index index.html; |
| 6 | + |
| 7 | + # Gzip compression |
| 8 | + gzip on; |
| 9 | + gzip_vary on; |
| 10 | + gzip_min_length 1024; |
| 11 | + gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/json; |
| 12 | + |
| 13 | + # SPA routing - serve index.html for all routes |
| 14 | + location / { |
| 15 | + try_files $uri $uri/ /index.html; |
| 16 | + } |
| 17 | + |
| 18 | + # API proxy to backend service (set BACKEND_UPSTREAM at runtime) |
| 19 | + location /api { |
| 20 | + proxy_pass http://${BACKEND_UPSTREAM}; |
| 21 | + proxy_http_version 1.1; |
| 22 | + proxy_set_header Upgrade $http_upgrade; |
| 23 | + proxy_set_header Connection 'upgrade'; |
| 24 | + proxy_set_header Host $host; |
| 25 | + proxy_cache_bypass $http_upgrade; |
| 26 | + proxy_set_header X-Real-IP $remote_addr; |
| 27 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 28 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 29 | + } |
| 30 | + |
| 31 | + # Docker registry API proxy |
| 32 | + location /v2 { |
| 33 | + proxy_pass http://${BACKEND_UPSTREAM}; |
| 34 | + proxy_http_version 1.1; |
| 35 | + proxy_set_header Upgrade $http_upgrade; |
| 36 | + proxy_set_header Connection 'upgrade'; |
| 37 | + proxy_set_header Host $host; |
| 38 | + proxy_cache_bypass $http_upgrade; |
| 39 | + proxy_set_header X-Real-IP $remote_addr; |
| 40 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 41 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 42 | + } |
| 43 | +} |
0 commit comments