Nginx setup with ssl:
Generate certificate from:
https://punchsalad.com/ssl-certificate-generator/
Update DNS record , wait for 5 mins and check the dns ex:
Once record is verified , download the cert from next page
rename the files accordingly
sudo mv your_domain_chain-CA.txt your_domain_chain.crt
sudo mv your_private-key.txt your_private.key
Install nginx
sudo apt update
sudo apt install nginx
create directory to store ssl certs and copy the downloaded cert files in Step 4
sudo mkdir /etc/nginx/certs
Create a nginx configuration file
vi /etc/nginx/sites-available/mysite.conf
server {
listen 80;
server_name $domainname; # update this
return 301 https://$server_name$request_uri; #redirect to https
}
}
server {
listen 443 ssl;
ssl_certificate /etc/nginx/certs/your_domain_chain.crt; # update this
ssl_certificate_key /etc/nginx/certs/your_private.key; # update this
server_name your_domain.com; # update this
location / {
proxy_pass http://localhost:8080;
}
}
Create symlink
sudo ln -s /etc/nginx/sites-available/dev-allbot.conf /etc/nginx/sites-enabled/
check configuration and reload nginx
sudo nginx -t && sudo nginx -s reload
, multiple selections available,