Created
December 30, 2022 17:41
-
-
Save gilangvperdana/2b18d64a24ada9561cb65e7c36ebe964 to your computer and use it in GitHub Desktop.
Nginx Block for Minio Behind Reverse Proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## MINIO | |
upstream console { | |
keepalive 32; | |
server 10.8.0.4:9091; | |
} | |
upstream cli { | |
keepalive 32; | |
server 10.8.0.4:9000; | |
} | |
server { | |
listen 80; | |
server_name drive.adaptivenetworklab.org; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443; | |
ssl on; | |
server_name drive.adaptivenetworklab.org; | |
ssl_certificate /etc/letsencrypt/live/drive.adaptivenetworklab.org/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/drive.adaptivenetworklab.org/privkey.pem; | |
# 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; | |
proxy_request_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 Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
chunked_transfer_encoding off; | |
proxy_pass https://console; | |
} | |
} | |
server { | |
listen 9000; | |
ssl on; | |
server_name drive.adaptivenetworklab.org; | |
ssl_certificate /etc/letsencrypt/live/drive.adaptivenetworklab.org/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/drive.adaptivenetworklab.org/privkey.pem; | |
# 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; | |
proxy_request_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 Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
chunked_transfer_encoding off; | |
proxy_pass https://cli; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment