Reputation: 404
I have created a website using angular that I am hosting on AWS EC2. I have done some research into how to get my server to be secure with https, and it looks like here are my options:
However, I am new to both AWS and Angular and don't really know where to go from here. My web server is run on Ubuntu, and the 2 tutorials on AWS are for Windows or Linux. Any resources/suggestions?
Upvotes: 0
Views: 761
Reputation: 8773
Angular provides the way to run your website on SSL
ng serve --ssl
Also, you can add SSL cert path in the angular.json file:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"projects": {
"<PROJECT-NAME>": {
"architect": {
"serve: {
"options": {
"sslKey": "<relative path from angular.json>/server.key",
"sslCert": "<relative path from angular.json>/server.crt",
...
}, ...
}, ...
}, ...
}, ...
}, ...
}
you can setup load balancer on EC2 instance using this guide:
Upvotes: 1
Reputation: 20276
The easiest way to add HTTPS IMO would be installing a web server (like NGINX
or Apache2
) as a reverse-proxy for your application. The purpose of a web-server in this case would be to accepts requests over HTTPS and forward them with HTTP to your application. Once the application responded, a reverse proxy would pass the response back to client using HTTPS.
If you have NGINX or Apache2 you can use certbot
to obtain and renew a certificate from letsencrypt. There are lots of guides how to setup all this on the Internet, just google for nginx letsencrypt angular
.
Upvotes: 0