Comments (7)
If a subdirectory has spaces or unicode characters it won't work, otherwise it will work.
I'm using a MinIO instance with NGINX reverse proxy
Here is a comparison of my server logs
This request is successful
127.0.0.1 - - [17/Dec/2023:15:40:42 +0100] "GET /photos/?prefix=The+Honkers%2F&delimiter=%2F&max-keys=1000 HTTP/1.1" 200 346292 "-" "Asgardius S3 Manager"
This one return an empty list
127.0.0.1 - - [17/Dec/2023:15:43:41 +0100] "GET /photos/?delimiter=%2F&encoding-type=url&fetch-owner=true&list-type=2&prefix=The%2520Honkers%2F HTTP/1.1" 200 309 "-" "MinIO (linux; amd64) minio-go/v7.0.65"
Here is another example
127.0.0.1 - - [17/Dec/2023:15:49:20 +0100] "GET /asgardiustest/?prefix=pe%C3%B1a%2F&delimiter=%2F&max-keys=1000 HTTP/1.1" 200 599 "-" "Asgardius S3 Manager"
127.0.0.1 - - [17/Dec/2023:15:50:31 +0100] "GET /asgardiustest/?delimiter=%2F&encoding-type=url&fetch-owner=true&list-type=2&prefix=pe%25C3%25B1a%2F HTTP/1.1" 200 314 "-" "MinIO (linux; amd64) minio-go/v7.0.65"
As you can see, this issue is due this client is asking wrong prefix
This app is encoding prefix name twice. I have a fix. I'm preparing a pull request for this
from s3manager.
@asgardius Thanks for the fix. Saved me some time hunting it down.
from s3manager.
@asgardius Could you please share your nginx reverse proxy config?
from s3manager.
@asgardius Could you please share your nginx reverse proxy config?
Here is my nginx config file
server {
server_name s3manager.example.com;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
client_max_body_size 0;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml image/x-icon;
location / {
proxy_pass http://127.0.0.1:8009;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic "Only Page Asgardius is allowed here";
auth_basic_user_file /etc/nginx/s3managerpasswd;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/s3manager.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/s3manager.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
from s3manager.
@asgardius How do we reverse proxy in the following scenario?
For example: If I want to proxy localhost:8080/buckets/my-bucket >> localhost/s3
I have tried a couple of different nginx proxy configs but none seem to be working properly.
from s3manager.
@asgardius How do we reverse proxy in the following scenario?
For example: If I want to proxy localhost:8080/buckets/my-bucket >> localhost/s3
I have tried a couple of different nginx proxy configs but none seem to be working properly.
It seems that is not possible without edit backend source code, but you can use the following aproach instead
server {
server_name s3manager.example.com;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
client_max_body_size 0;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml image/x-icon;
#api and buckets endpoints are required
#Page Asgardius is an admin user
location /buckets {
proxy_pass http://127.0.0.1:8009/buckets;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic "Only Page Asgardius is allowed here";
auth_basic_user_file /etc/nginx/s3managerpasswd;
}
location /api {
proxy_pass http://127.0.0.1:8009/api;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic "Only Page Asgardius is allowed here";
auth_basic_user_file /etc/nginx/s3managerpasswd;
}
#Emily Asgardius is an user that only can access a specific bucket
location /buckets/emily {
proxy_pass http://127.0.0.1:8009/buckets/emily;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic "Only Emily Asgardius is allowed here";
auth_basic_user_file /etc/nginx/s3managerpasswd-emily;
}
location /api/buckets/emily {
proxy_pass http://127.0.0.1:8009/api/buckets/emily;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic "Only Emily Asgardius is allowed here";
auth_basic_user_file /etc/nginx/s3managerpasswd-emily;
}
#We have a test bucket with limited storage quota where everybody can test this app
location /buckets/public {
proxy_pass http://127.0.0.1:8009/buckets/public;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
location /api/buckets/public {
proxy_pass http://127.0.0.1:8009/api/buckets/public;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
#This will redirect users to public bucket when entering subdomain in url bar
location = / {
return 302 https://$host/buckets/public;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/s3manager.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/s3manager.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
from s3manager.
@asgardius How do we reverse proxy in the following scenario?
For example: If I want to proxy localhost:8080/buckets/my-bucket >> localhost/s3
I have tried a couple of different nginx proxy configs but none seem to be working properly.
It seems that is not possible without edit backend source code, but you can use the following aproach instead
server {
server_name s3manager.example.com;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
client_max_body_size 0;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml image/x-icon;
#api and buckets endpoints are required
#Page Asgardius is an admin user
location /buckets {
proxy_pass http://127.0.0.1:8009/buckets;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic "Only Page Asgardius is allowed here";
auth_basic_user_file /etc/nginx/s3managerpasswd;
}
location /api {
proxy_pass http://127.0.0.1:8009/api;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic "Only Page Asgardius is allowed here";
auth_basic_user_file /etc/nginx/s3managerpasswd;
}
#Emily Asgardius is an user that only can access a specific bucket
location /buckets/emily {
proxy_pass http://127.0.0.1:8009/buckets/emily;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic "Only Emily Asgardius is allowed here";
auth_basic_user_file /etc/nginx/s3managerpasswd-emily;
}
location /api/buckets/emily {
proxy_pass http://127.0.0.1:8009/api/buckets/emily;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic "Only Emily Asgardius is allowed here";
auth_basic_user_file /etc/nginx/s3managerpasswd-emily;
}
#We have a test bucket with limited storage quota where everybody can test this app
location /buckets/public {
proxy_pass http://127.0.0.1:8009/buckets/public;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
location /api/buckets/public {
proxy_pass http://127.0.0.1:8009/api/buckets/public;
proxy_set_header Host $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-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
#This will redirect users to public bucket when entering subdomain in url bar
location = / {
return 302 https://$host/buckets/public;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/s3manager.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/s3manager.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
from s3manager.
Related Issues (20)
- USE_IAM not working HOT 1
- s3 manager is unable to list files HOT 1
- how to create webview HOT 2
- Support to view public buckets HOT 1
- S3 Manager for buckets have lots of object not working
- Support for "subdirectories" HOT 2
- s3manager.exe read CPUID HOT 4
- error parsing multipart form ... i/o timeout HOT 1
- Multiple s3 instances support HOT 1
- CSS does not load properly after last update
- Workaround to List Additional Shared Buckets HOT 1
- Unable to connect to MinIO locally
- login form
- Cant delete file that has symbol '%'
- Feature request: Delete directories/prefix HOT 1
- support showing image/video thumbs
- 404 when download file
- How to work only with one bucket?
- Feature: add Action - open
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s3manager.