Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
How do I force SSL on my Nginx server?
My server is all set up for the most part, except one thing. The only thing I still have to do is add SSL to it so that I can make it more secure.
I used the Vesta control panel to generate my CSR key, which I then linked to my SSL that I got from namecheap. I did the email confirmation and all that, and it says my website has SSL support according to the vesta cp. However, when I go to www.mywebsite.com, it says my website connection is not secure. For reference, after I installed and activated the SSL, I was told to follow this guide: www.vestacp.com/docs/#how-to-force-https.
I followed step 1, which was to install a custom nginx template. I then inputted these commands:
tar -xzvf nginx.tar.gz
rm -f nginx.tar.gz
The steps after I inputted those commands are listed as so:
- Create new package or set force-https as nginx template in the existing package
- Add new user and assing him package with force-https template
- Add new domain with SSL certificate and check the result
I have no idea how to do this. I know how to edit my conf. files by using sudo nano and all that, so I am not a total noob when it comes to CLI.
Any help would be appreciated, this is the last building block that I have to overcome before I can put my website into work. After I did the rm -f nginx.tar.gz command, I have no idea what to do next. Any help would be appreciated.
For reference for what to install the SSL keys, I followed this: https://www.namecheap.com/support/knowledgebase/article.aspx/9681//installing-a-ssl-certificate-in-vesta-cp.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×