Skip to content

Commit 7a5d1e0

Browse files
committed
Enhance Nginx configuration: add API proxy settings with increased timeouts and buffering options for file uploads, while updating deployment workflow to include Nginx directory filtering.
1 parent cf0124a commit 7a5d1e0

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

.github/workflows/deploy-to-ssh-server.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
with:
3333
filters: |
3434
nginx:
35+
- 'nginx/**'
3536
- 'nginx.Dockerfile'
3637
list-files: shell
3738

nginx/default.conf

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,26 @@ server {
5757
proxy_buffers 8 4k;
5858
proxy_busy_buffers_size 8k;
5959

60-
# Proxy to website service
60+
# Proxy API requests to website service (which proxies to server)
61+
# This should be before the general location / block
62+
location /api {
63+
proxy_pass http://website:8080;
64+
proxy_http_version 1.1;
65+
proxy_set_header Upgrade $http_upgrade;
66+
proxy_set_header Connection 'upgrade';
67+
proxy_cache_bypass $http_upgrade;
68+
69+
# Increase timeouts for file uploads/downloads
70+
proxy_connect_timeout 300s;
71+
proxy_send_timeout 300s;
72+
proxy_read_timeout 300s;
73+
74+
# Disable buffering for large files
75+
proxy_buffering off;
76+
proxy_request_buffering off;
77+
}
78+
79+
# Proxy to website service for all other routes
6180
location / {
6281
proxy_pass http://website:8080;
6382
proxy_http_version 1.1;
@@ -66,4 +85,3 @@ server {
6685
proxy_cache_bypass $http_upgrade;
6786
}
6887
}
69-

0 commit comments

Comments
 (0)