Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

How to have one vhost for www/non-www + http to https

$
0
0
I'm looking to have one nginx host file which handles domain.tld and www.domain.tld with and without https and redirects all of them to use https and www so any visitor would end up at https www.domain.tld

I've tried various options and one of these 4 options was always incorrect.

My best lead so far is this advice I got: https://gist.github.com/bjornjohansen/b5a763a57a460edac47c8560502f6400 - does that look like hte best solution?
If it does could someone help me with what would go in the 2nd server block?

here is my real vhost config: http://pastebin.com/fYq2CjLf

any help is much appreciated, been struggling with this all day.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>