如何在Nginx反向代理之后集成Minio并与JavaScript API交互?
在过去的两周里,我一直在尝试启动并运行minio服务,但我无法解决这个错误 我首先创建了一个nginx服务,该服务使用他们提供的minio默认配置的修改版本(): 我的JavaScript配置如下:如何在Nginx反向代理之后集成Minio并与JavaScript API交互?,nginx,minio,Nginx,Minio,在过去的两周里,我一直在尝试启动并运行minio服务,但我无法解决这个错误 我首先创建了一个nginx服务,该服务使用他们提供的minio默认配置的修改版本(): 我的JavaScript配置如下: const Minio=require('Minio'); const minioClient=新的Minio.Client({ 端点:“fs theorie.de”, 港口:80, usesl:false, accessKey:“minioaccess”, 秘钥:“Miniosecret”, })
const Minio=require('Minio');
const minioClient=新的Minio.Client({
端点:“fs theorie.de”,
港口:80,
usesl:false,
accessKey:“minioaccess”,
秘钥:“Miniosecret”,
});
用以下方法敲击铲斗时
const bucket={
fetchbucket(){
试一试{
minioClient.ListBucket(函数(err,bucket){
if(err)返回console.log(err);
console.log('bucket:',bucket);
});
}捕获(错误){
控制台错误(error);
}
},
};
Firefox告诉我:Cross-source(decision):同一源代码规则禁止在浏览器上阅读学习资源http://fs-theorie.de/.
Chrome告诉我:
GEThttps://fs-theorie.de net::ERR_CONNECTION_拒绝
,没有任何进一步的信息
我不知道下一步该去哪里,因为我尝试了我所知道的关于系统集成的一切
谢谢你的帮助 您能在浏览器中运行它吗?如果是,则尝试不使用“端口”选项通过sdk连接。默认情况下,如果禁用ssl,它将占用端口80。您可以在浏览器中运行它吗?如果是,则尝试不使用“端口”选项通过sdk连接。默认情况下,如果禁用ssl,它将占用端口80
server {
listen 80;
server_name fs-theorie.de;
# 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 / {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS','DELETE';
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 Host $http_host;
proxy_connect_timeout 300;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
proxy_set_header Connection "";
chunked_transfer_encoding off;
proxy_pass http://bucket:9000; # If you are using docker-compose this would be the hostname i.e. minio
# Health Check endpoint might go here. See https://www.nginx.com/resources/wiki/modules/healthcheck/
# /minio/health/live;
}
}