Skip to content

Commit

Permalink
feat(#416): Exposing minio on proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
tholulomo committed Jul 18, 2023
1 parent 4aa4124 commit dcc9da0
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ upstream api {
server api:3001;
}

upstream minio {
server minio:9000;
upstream console {
server minio:9001;
}

server {
Expand All @@ -20,6 +20,7 @@ server {
}

location /sockjs-node {
rewrite /sockjs-node/(.*) /$1 break;
proxy_pass http://client;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
Expand All @@ -43,28 +44,48 @@ server {
proxy_connect_timeout 1500;
proxy_send_timeout 1500;
send_timeout 1500;

# To support websocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

chunked_transfer_encoding off;
}
}

location /storage {
sendfile on;
keepalive_timeout 60;
default_type application/octet-stream;
server {
listen 9001;
listen [::]:9001;
server_name localhost;

client_max_body_size 0;
# To disable buffering
proxy_buffering off;
proxy_request_buffering off;
# To allow special characters in headers
ignore_invalid_headers off;
# Allow any size file to be uploaded.
# Set to a value such as 1000m; to restrict file size to a specific value
client_max_body_size 0;
# To disable buffering
proxy_buffering off;

location / {
proxy_set_header Host $http_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;
proxy_set_header X-NginX-Proxy true;

# This is necessary to pass the correct IP to be hashed
real_ip_header X-Real-IP;

proxy_connect_timeout 300;

# To support websocket
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

chunked_transfer_encoding off;

proxy_pass http://minio;
proxy_pass http://console;
}
}

0 comments on commit dcc9da0

Please sign in to comment.