27 C
Jaipur
Monday, October 26, 2020

How to setup HTTPS with Laravel Homestead – Linux Hint

Must read

How To Get MIUI 12 Dynamic Nebula Wallpapers On Any Xiaomi Device?

Super Wallpapers, hands down, is one of the best features of MIUI 12. The 3D interactive live wallpapers of Earth, Mars, and Saturn are...

Flipkart quiz October 26, 2020: Get answers to these questions to win gifts,vouchers and super coins

Flipkart’s daily trivia questions are now live. It starts daily at 12am and continues till 12pm. Those participating in the quiz have a chance...

Planning to buy new iPhone? This is how much Apple may give you for your old iPhone or Samsung, OnePlus phone

Planning to buy new iPhones? Wonder how much exchange value you will get for your current iPhone or Samsung, OnePlus phone? Apple has detailed...

8 Ways to Check CPU Clock Speed on Linux

A CPU clock speed determines how fast your CPU can process instructions every second. It measures the number of cycles your CPU can execute,...

You probably noticed that you can’t use your website-example.dev with your Chrome, as it is reporting that your website is not secure.

I am using Homestead 5 and by default homestead uses nginx to server your files. If you have a website-example.dev defined in your Homestead.yaml, then if you go in /etc/nginx/ssl/you will find two files for your domain:

website-example.dev.key website-example.dev.crt website-example.dev.key

All you have to do is (if you are on Mac OS) is get this website website-example.dev.crtinside your Keychain Access, and set to trust this certificate.

In order to use this file, you can vagrant ssh and copy this file to your shared folder:

sudo cp /etc/nginx/ssl/website-example.dev.crt /home/vagrant/Code/ssl

Now you can access this file from your Mac OS (wherever you setup your source folder).

Then below the All Items, click on Certificates, and find your website-example.dev.crt

Then double click on it and select to Trust -> Always trust.

And that’s it. Now your setup is closer to what you should have on your production and can operate on HTTPS.

Also you may want to have a permanent redirection from http to https

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name website-example.app;
return 301 https://website-example.app;
}

This should be placed at the top of

sudo vim /etc/nginx/sites-available/website-example.app

Source link

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How To Get MIUI 12 Dynamic Nebula Wallpapers On Any Xiaomi Device?

Super Wallpapers, hands down, is one of the best features of MIUI 12. The 3D interactive live wallpapers of Earth, Mars, and Saturn are...

Flipkart quiz October 26, 2020: Get answers to these questions to win gifts,vouchers and super coins

Flipkart’s daily trivia questions are now live. It starts daily at 12am and continues till 12pm. Those participating in the quiz have a chance...

Planning to buy new iPhone? This is how much Apple may give you for your old iPhone or Samsung, OnePlus phone

Planning to buy new iPhones? Wonder how much exchange value you will get for your current iPhone or Samsung, OnePlus phone? Apple has detailed...

8 Ways to Check CPU Clock Speed on Linux

A CPU clock speed determines how fast your CPU can process instructions every second. It measures the number of cycles your CPU can execute,...

How to Configure NGINX as TCP/UDP Load Balancer in Linux

As we know NGINX is one of the highly rated open source web server but it can also be used as TCP and UDP...