How to setup MinIO Server to use Virtual Hosted-Style - minio

I'm using aws-sdk-go (https://github.com/aws/aws-sdk-go) to connect so AWS S3. I also want to support MinIO (http://minio.io/) through the same code. But due to some restrictions on my part I can't use S3ForcePathStyle flag in config. Is there any way I can setup my MinIO server to support Virtual Hosted-Style paths?
P.S. I also tried setting MINIO_DOMAIN environment variable as instructed here https://docs.min.io/docs/minio-server-configuration-guide.html
Thanks in advance!

By default, MinIO supports path-style requests that are of the format http://example.com/bucket/object. MINIO_DOMAIN environment variable is used to enable virtual-host-style requests. If you configure MINIO_DOMAIN, MinIO will support both path-style and virtual-host-style requests from the clients.
export MINIO_DOMAIN=mydomain.com
minio server /data

Related

Loading storage files from another server

I've put the database and files on separate servers (because I've set up 3 servers for our web application and use the load balancer for them) and I use SFTP for filestorage driver.
Because I've used the SFTP driver for Laravel file storage, the SSH connection to the destination server will increase and the SSH port will be block and the files cannot load from the storage server.
What should I do? is there any other solution to load files from another server?
I recommend using a cloud storage for this usecase, in which one can set the CORS settings. You could for instance use aws s3 for this or use digital ocean spaces which has a similiar api to s3.
You basically post your to that cloud server and save the url to your database.
Of course you need to set of the cors settings, to basically say that server x can access specific files on the cloud storage.

How to host Moqui on AWS EC2

Is there a way to host Moqui on AWS? I was trying to host Moqui using a EC2 instance but couldn't figure out a way to connect them.
The Run and Deploy document on moqui.org has a section for a simple recommended deployment using ElasticBeanstalk and RDS:
https://www.moqui.org/m/docs/framework/Run+and+Deploy#AWSElasticBeanstalkandRDS
With more details about how you want to set things up on AWS the answer to how might vary from this.
For clustered setups things get more involved to get the right settings for Hazelcast AWS discovery and it is best to use an external ElasticSearch server like an AWS ElasticSearch instance and configure Moqui using environment variables to use the Java REST Client mode instead of the Embedded Node mode. Settings for the moqui-hazelcast and moqui-elasticsearch components can be seen in the MoquiConf.xml file in each component.

spring-cloud-config fallback server

Can spring-cloud-config be configured to have more than one config server? So that if one would fail, it would fall back to another one?
If that is possible, and the 2 severs are using filesystem instead of git, is there a sync between those, or do both have to be updated manually?
I did not find this directly in config server. But you can use discovery service as eureka and have as many config server instances as you want: http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#eureka-first-bootstrap
From docs: "To scale the Config Server up and make it highly available, you would need to have all instances of the server pointing to the same repository, so only a shared file system would work. " you can use rsync for that.

Can I store static files on nginx whith cloudbees?

As far as I know, cloudbees is using nginx servers for routing the requests.
I am wondering if there is a way to drop my static files on nginx to make it serves my static files and save some load on my application server.
M.
On runtime the file system is "ephermeral". You have more info about it here.
You should use an external service like Amazon S3. The Amazon S3 ClickStart explains how to use this service from CloudBees.
You can also use other services like Dropbox or Google Drive.

Detect Amazon VM (Windows)

Is there any way to programmatically detect that my C/C++ Windows application is running on an Amazon Cloud server? E.g., any APIs, WScripts, or environment variables? Thanks.
Make a HTTP GET against http://169.254.169.254/latest/meta-data/ on the instance.
On EC2(windows or *nix), you will receive information about the instance
See:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html

Resources