AWS deploy (v.2.15.0, CloudFormation) - 404 Not Found - nginx 1.18

Hi All,
I deployed OpenVidu on AWS (ver. 2.15.0) following the CloudFormation walkthrough on OpenVidu docs.

After setting all the params, I got the aws instance running, but when I tried to access the service with the public IP or with the Domain name, I’m getting the following error:

404 Not Found - nginx 1.18

I have another instance on AWS running OpenVidu ver. 2.14.0, and it is working fine, when going to the server IP or domain name, I’m getting:

Welcome to OpenVidu Server

Can someone help me resolve this issue?

Many thanks

Hi @israelws, what parameters are you using for your Cloudformation? Can you ssh into the instance and go to /opt/openvidu and execute:

./openvidu logs

Regards,
Carlos

Hi Carlos,
please find the following image from the AWS server:

It looks like the server started correctly, but the Nginx service may not route the incoming requests to the openvidu service.

Thanks,
Israel

Could you please show me your NGINX logs?. Maybe restart all the services solve your problem.

cd /opt/openvidu
sudo ./openvidu restart

Or maybe there’s something wrong in the configuration. What parameters do you have in your .env file? (Hide your secret)

Regards,
Carlos

I just tried this, restart logs are ok. after the same issue still exists.

Please, what parameters did you use in your cloudformation and what region are you using? It is just to tests in my own AWS account what the problem could be.

Regards,
Carlos

These are the parameters I used:
Instance type: t2.xlarge
KeyName: (my SSH key)
LetsEncryptEmail : isralog@gmail.com (I used LetsEncrypt)
MyDomainName: ovd.cmt.biz

I also used this template for the deployment:
https://s3-eu-west-1.amazonaws.com/aws.openvidu.io/CF-OpenVidu-latest.yaml

From what I can see in your logs, I think you’ve filled the Cloudformation template with selfsigned in Certificate type, but you must use letsencrypt in the certificate type. You also need an Elastic IP. Check this example and check what type of certificate you have used and if you’re using an Elastic IP:

I did use LetsEncrypt, SelfedSigned is the default, but I changed it.
Once defined, the AWS CloudFormation is assigning ElasticIP.

Did you update it through CloudFormation?

After deploying with CloudFormation, if you need to change anything of the configuration, some changes will not apply using the control panel of Cloudformation. There’s some scripting in the OpenVidu EC2 instance and this kind of changes are not detected by cloudformation. You need to ssh into OpenVidu EC2 instance and edit the file located in /opt/openvidu/.env and change these parameters:

DOMAIN_OR_PUBLIC_IP=ovd.cmt.biz

CERTIFICATE_TYPE=letsencrypt

LETSENCRYPT_EMAIL=isralog@gmail.com

And restart openvidu as you know.

If you still having problems with certificate, try to remove the directory /opt/openvidu/certificates and restart again.

I hope this helps.
Regards,
Carlos

estoy en el mismo problema y ni con la version 2.14 me funciona :frowning:

@Marco_Flores what configuration do you have in your /opt/openvidu/.env? Do you have a configured Domain name? If you’re using letsencrypt as @israelws you must have a domain name pointing to the public Ip of your instance.

Please @israelws, how is your deployment going?

Regards,
Carlos

Please, check these examples of configuration:

seguí esa documentación. que es la oficial de openvidu.


certificate_type: letsencrypt
email: m.flores.ramirez1705@gmail.com
https_port=443

esto es en mi pila en aws, lo primero que se crea para que de la salida:

InstanceType t2.xlarge -
KeyName SK01 -
LetsEncryptEmail m.flores.ramirez1705@gmail.com -
MyDomainName goijob.atwebpages.com -
OpenViduSecret **** -
OwnCertCRT - -
OwnCertKEY - -
PublicElasticIP 54.92.236.226 -
WantToDeployDemos true -
WantToSendInfo true -
WhichCert letsencrypt -

i do the example number 2.

@Marco_Flores the domain name you’re using is not pointing to 54.92.236.226
image

If this is a domain used by other service you have, you need a new one for OpenVidu. For example you can create a subdomain like openvidu.atwebpages.com and this subdomain must point to 54.92.236.226

When the Domain name is pointing to 54.92.236.226, change your DOMAIN_OR_PUBLIC_IP to openvidu.atwebpages.com (if you configured that one) in your /opt/openvidu/.env file.

After that remove the folder /opt/openvidu/certificates and restart openvidu with ./openvidu restart

Regards,
Carlos

thank you Carlos. That solved the problem!

I changed the param:
“DOMAIN_OR_PUBLIC_IP =”
to the actual domain that I’m using (I did enter it during the CloudFormation setup).
The value was the EC2 public ip4 DNS -> ec2-79-125-91-17.eu-west-1.compute.amazonaws.com

After changing I restarted the openVidu service and it is working now.

It may. be something with the CloudFormation new script, that for some reason is not updating this param with the domain value that I entered (I repeated this process many times) .

Thanks again.
Israel

Correct, that’s the problem. Unfortunately It is not possible to detect some changes in the cloudformation. We recommend to make changes directly in the .env file because of that.

Regards,
Carlos