Issuing SSL Certificate
SSL certificate on : dashboardapi.hicare.in
Steps:
openssl req -new -newkey rsa:2048 -nodes -keyout dashboardapi_hicare_in.pem -out dashboardapi_hicare_in.csr -subj /CN=dashboardapi.hicare.in; cat dashboardapi_hicare_in.csrsudo scp -i 'Dashboard Server Key.pem' 'dashboardapi.hicare.in_cert.zip' ubuntu@15.207.50.230:/home/ubuntu/unzip 'dashboardapi.hicare.in_cert.zip' -d ./dashboardapi.hicare.in_certcd dashboardapi.hicare.in_cert
sudo cp -r * /etc/ssl/cd /etc/ssl/
cat dashboardapi.hicare.in.crt dashboardapi.hicare.in.ca-bundle >> ssl-bundle.crtcd /etc/nginx/sites-available/
mv default default2
sudo nano defaultserver {
listen 80;
listen 443 ssl; #better to use this
server_name dashboardapi.hicare.in;
#ssl on; #ssl on is deprecated now.
ssl_certificate /etc/ssl/ssl-bundle.crt;
ssl_certificate_key /etc/ssl/dashboardapi_hicare_in.pem;
#global http handler
if ($scheme = http){
return 301 https://dashboardapi.hicare.in$request_uri;
}
ssl_stapling on;
ssl_stapling_verify on;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /omdashboard/ {
proxy_pass http://127.0.0.1:5000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /rmdashboard/ {
proxy_pass http://127.0.0.1:5001/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /portalapi/ {
proxy_pass http://127.0.0.1:5002/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

🎉 Congrats, your website is hosted on dashboardapi.hicare.in and auto redirected (HTTP to HTTPS) with SSL Certificate.
Last updated