Adding domain name in digitalocean droplet - reactjs

I have recently bought a domain from Godaddy. I have done the necessary setups to connect it with digitalocean droplet. I can access the website using the domain. The domain is by default using HTTPS. But inside the web app, I have made HTTP requests(for login, sign up). These network requests aren't being made if I access the website using the domain name. But if I access it by using the IP address of the droplet, those network requests were working. I guess the problem is with the domain. There is no SSL certificate present in the droplet. I am using the Nginx server in the droplet. I have used React to build the website.
I am new to web hosting. Can anybody tell me what's wrong here and how to fix this?

If I understood your question correctly, i think the issue might be in nginx config.
SSL requests that are coming to your droplet over HTTPS should be decrypted somewhere... You can either do it in nginx by using a certificate and modifying your nginx config accordingly, or you can use a digital ocean load balancer in front of your server and configure that load balancer to terminate SSL (you can get a digital ocean managed cert)... In both of these cases, your app will receive un-encrypted traffic.
These links might help:
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-load-balancing-with-ssl-termination
https://www.digitalocean.com/docs/networking/load-balancers/how-to/ssl-termination/

Related

Github pages doesnt show HTTP urls

I have a React website hosted on Github Pages, and a Flask Server running to put information on my ArangoDB server which is hosted on a machine that has HTTP address lets call it (http://21.23.24.25:8352)
The problem is that I try to show images which are stored on my local server for e.g.: http://21.23.24.25:8352/data/images/image.jpg
and I'm getting an error: net::ERR_SSL_PROTOCOL_ERROR
How can I bypass this other than creating a new ArangoDB server hosted on another machine, or creating a SSL Certificate on the machine.
I also paid for the pythonanywhere subscription, I thought maybe it was required to bypass the SSL issue. Any ideas?

intermediate hops in nginx reverse proxy

I am new to nginx and doing full stack development for the first time. Could you please help me understand the below logic
Lets say we are building a chatting app. We have 3 servers (EC2 instances)
server_nginx - ec2 running a nginx server working as reverse proxy
server_react - ec2 running a react project through nginx as web server
server_spring - ec2 running a spring boot project through nginx as web server
My reverse proxy is running through SSL/https. Initially everything was happening on same machine, so I made my spring boot service also ssl because I could not initiate a http connection over https. Now the I started separating out the instance as mentioned above (3 ec2 instances). I was expecting that the connection to my backend would fail. Reason :
user connects to reverse proxy through https domain (lets say mydomain.com).
The request comes to server_nginx(mydomain.com).
From here this proxies this to server_react (which is running on simple http). This is the server where my react code is hosted
This react code tries to initiate a web socket connection to server_spring where I have enabled the CORS for mydomain.com. So I was expecting that the connection would fail here as this is a different IP now. But surprisingly all the apis are getting the response as if I am hitting it from mydomain.com
So can anyone please help me understand why is the behaviour like this
Thanks.

Provisioning SSL certs for Google App Engine app w/custom domain DNS

I purchased a custom domain mydomain.com w/Google Domains last year. Until earlier this week, I was hosting a small single-page React app on that domain (in a Cloud Storage bucket) that connected to a GAE Flask app backend. Wasn't using SSL anywhere. All was well.
I now wish to use SSL. Since I'm new to all of this stuff, I followed the documentation to map my custom domain and secure it with SSL using Google-managed SSL certs. During this process, I created my first load balancer in GCP, then updated my domain's DNS entries for # A and www A to the LB's IP. The guides didn't say anything about changing the # AAAA entries, so I left them in place. Cloud CDN is disabled. Google Domains DNS Settings:
When creating the Google-managed SSL cert, I entered both mydomain.com and www.mydomain.com since I want both addresses to be secured w/SSL. After a few hours, the domain status for www.mydomain.com became active, but the status is FAILED_NOT_VISIBLE for mydomain.com. Guessing this is the source of my problems? Google SSL Cert Statuses:
Troubleshooting tips for this error:
The SSL Certificate isn't attached to the load balancer's target proxy. To resolve this issue, update the load balancer configuration. Done, and confirmed via both the GCP UI and the gcloud cli.
The domain's DNS record doesn't resolve to the IP address of the Google Cloud load balancer. To resolve this issue, update the DNS records to point to the load balancer's IP address. Thought I did this too, see my GAE custom domain settings below:
Attempting to load to mydomain.com or www.mydomain.com in the browser yields:
This site can’t provide a secure connection
www.mydomain.com uses an unsupported protocol.
ERR_SSL_VERSION_OR_CIPHER_MISMATCH
Unsupported protocol
The client and server don't support a common SSL protocol version or cipher suite.
It's been ~40hrs since I created the LB and updated the DNS settings for my domain, so I suspect the issue is my config and not DNS propagation. Where am I going wrong?
EDIT
Editing to clarify a few critical things:
I'm hosting my UI as a static website in a Google Cloud Storage bucket. Cloud Storage doesn't support HTTPS on its own, and therefore requires an HTTPS load balancer to work with custom domains.
If I wanted to go down this path, I'd need to ensure the load balancer pointed to my Cloud Storage bucket, which wasn't mentioned in my original post.
To roll back all changes from this SSL attempt, I'd need to update the # A DNS entry to the GAE IP, then update the www CNAME entry to c.storage.googleapis.com.. Note this CNAME entry is for Cloud Storage, not for GAE.
I ended up aborting the SSL idea and going with #3 (for now). The app in question is for a personal project that doesn't deal with any sensitive info, so SSL really isn't necessary.
You’ve gone through the process and receive the message:
ERR_SSL_VERSION_OR_CIPHER_MISMATCH
I’ve found some information for you. The main points are listed below.
Verify SSL Status of Website,
Check for Certificate Name Not Matching
Verify TLS Version
Verify RC4 Cipher Suite
Manually Inspect Security Certificate
There is more detail in this document here

How to configure connection to service with SSL Certificate when using not apache service. SOS

I am an University student. And today I am dealing with different web services. I am using apache2 service for starting page and running it with my letencrypt certificate and all works perfect. But my apache redirect user to ReactJs service on another port (:3000) i am use https connection also, but on this port my valid certificate gone and React use some self-signed certificate. How i read in google, react can't use SSL and i must somehow configure apache to serve this port with valid SSL, maybe i am wrong. SOS guys
So my question is:
How i can setup valid SSL for my ReactJS app on :3000 port?
How i can even setup certificate for another ports than apache?
Is it possible somehow run ReactJs with SSL?(i am using HTTPS=true npm start)
I Hope somebody can help me, i am already spent all day looking and reading. No answers at all.
Is it possible to configure valid certificate to an HTTPS acceptable ReactJs service?
P.S By the way i am using Ubuntu 16.04 on a Virtual Machine.

How to host a dynamic AngularJS web app in AWS and access it in browser

How to host my dynamic angular web app in AWS EC2 instance and access it through browser. Adding custom inbound rules didn't worked for me. May be I have done it wrong. Can someone explain the process to be followed.
Assuming that you have configured a webserver(Nginx/Apache etc..) correctly on your EC2 on a certain port(eg: Port 80), check your EC2 security group configurations.
In the above picture, You might set SSH to access only from your IP rather than from Anywhere.

Resources