# Ghost CLI optional force https

**URL:** <https://forum.ghost.org/t/ghost-cli-optional-force-https/761>\
**Category:** Ideas\
**Created:** [April 5, 2018, 4:34pm UTC](https://forum.ghost.org/t/ghost-cli-optional-force-https/761 "2018-04-05T16:34:12Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Juan](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/juan/32/25_2.png) [@Juan](https://forum.ghost.org/u/Juan)\
**Post date:** [April 6, 2018, 10:49am UTC](https://forum.ghost.org/t/ghost-cli-optional-force-https/761/5 "2018-04-06T10:49:07Z")

</div>

Probably they could be several redirects at the same time, if we follow Google’s classical advice on _either all www or all non-www_ ([SEO advice: url canonicalization - Matt Cutts](https://www.mattcutts.com/blog/seo-advice-url-canonicalization/)).

For example, if we want Nginx redirects for **http → https** and **www → non-www** :

```auto
server {
	listen 93.184.216.34:80;
	server_name example.com www.example.com;
	return 301 https://example.com$request_uri;
}

server {
	listen 93.184.216.34:443 ssl http2;
	server_name www.example.com;
	ssl_certificate /etc/letsencrypt/(...).cer;
	ssl_certificate_key /etc/letsencrypt/(...).key;
	return 301 https://example.com$request_uri;
}

server {
	listen 93.184.216.34:443 default_server ssl http2;
	server_name example.com;
	ssl_certificate /etc/letsencrypt/(...).cer;
	ssl_certificate_key /etc/letsencrypt/(...).key;
	(...)
}

```

(93.184.216.34 is [example.com](http://example.com)’s IP)

* * *

**Update:** Although this simple configuration works, see [another example below](https://forum.ghost.org/t/ghost-cli-optional-force-https/761/10) on this thread, more compatible with Ghost CLI’s files, Let’s Encrypt renewals, etc.

---

_[View the full topic](https://forum.ghost.org/t/ghost-cli-optional-force-https/761)._
