How to Static Web ReactJs using Spaces Digitalocean

Ib Ez
3 min readAug 11, 2021

hi this moment i make tutorial again about How to Static Web ReactJs using Spaces Digitalocean.

here I made it with Spaces digitalocean with NGINX as proxy to Spaces.

The package that must be installed on Linux is:

1. Droplet using linux centos
2. NGINX
3. latest aws-cli (since Spaces uses AWS S3) for upload result build to the Spaces with shell command or you can used s3cmd.

I assume you have all installed. let’s begin

after you finish install nginx you open

/etc/nginx/nginx.conf

like this:

and then you create configure file in the path

/etc/nginx/conf.d/rules.headers.proxy.conf

rules.headers.proxy.conf

after you finish created file above.

you can to create spaces, after you create it will be like this..

spaces.png

after you create it you have to create a new Key there you will get the key which is where this key is used in the aws cli

access_key.png

finished you get the key now you do is with the command

aws configure

as follows:

finish, you just have to build your reactjs then you just upload it and give permission to public all.

done, great. you have successfully created a static web in spaces digitalocean just you open on the browser with url.

darwin.png

you can take a look at this server from nginx proxypass to spaces

inspact.png

i make shell script for build and upload to spaces like this:

After that you just run:

./deploy-client.sh

so, aws-cli and s3cmd for delete and upload.

easy isn’t it. you can do in your droplet digitalocean

--

--