# Enforce SSL on WP Interface with NGinx

**URL:** <https://community.localwp.com/t/enforce-ssl-on-wp-interface-with-nginx/50416>\
**Category:** Feature requests\
**Created:** [June 5, 2025, 3:00pm UTC](https://community.localwp.com/t/enforce-ssl-on-wp-interface-with-nginx/50416 "2025-06-05T15:00:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabiofava](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/fabiofava/32/5240_2.png) [@fabiofava](https://community.localwp.com/u/fabiofava)\
**Post date:** [June 5, 2025, 3:00pm UTC](https://community.localwp.com/t/enforce-ssl-on-wp-interface-with-nginx/50416/1 "2025-06-05T15:00:24Z")

</div>

Hey folks! It could be nice to have an option to _Enforce SSL_ on the sites when using _Site Domains_ and running under _NGinx_. With _Apache_ it’s easy but with _NGinx_, every tip we find on the internet doesn’t work on _LocalWP_ version of _.conf_ as I’ve seen others say here at the forums.

Would there be a way to enforce directly on the _NGinx .conf_ file? I’ve been searching here on this forums but couldnt find any tip on how to enforce _SSL_ when the _WordPress_ site is runing under _NGinx_.

Thank you very much in advance, cheers!

---

<div class="post-metadata">

**Author:** ![Nick-B](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/nick-b/32/16140_2.png) [@Nick-B](https://community.localwp.com/u/Nick-B)\
**Post date:** [June 6, 2025, 1:38pm UTC](https://community.localwp.com/t/enforce-ssl-on-wp-interface-with-nginx/50416/2 "2025-06-06T13:38:26Z")

</div>

Hi @fabiofava!

The short answer is we don’t have a simple Force HTTPS/SSL option at this time but it’s definitely a feature request we’ve seen users express interest in:

> [@Is it possible to force https by default?](https://community.localwp.com/t/is-it-possible-to-force-https-by-default/12261/5):
>
> Hey @Ruben1 – I agree that this can get tedious. We do have a few open feature requests for making HTTPS in Local better, you might want to up-vote them to get them prioritized: [Open site with https when SSL is enabled](https://community.localwp.com/t/open-site-with-https-when-ssl-is-enabled/193)[HTTPS option when adding a new site](https://community.localwp.com/t/https-option-when-adding-a-new-site/2112)[Automattic HTTPS / SSL Provisioning](https://community.localwp.com/t/automattic-https-ssl-provisioning/10015) In the meantime, I know that under Mac, the security settings are such that you need to manually add the key to Keychain every time. As for changing the URL within the DB, one thing you might consider doing…

> with _NGinx_ , every tip we find on the internet doesn’t work on _LocalWP_ version of _.conf_ as I’ve seen others say here at the forum

Could you expand on anything you’ve tried or seen attempted so far that hasn’t worked? I’ve never attempted this myself, so I don’t want to provide something you’ve already tried.

---

<div class="post-metadata">

**Author:** ![fabiofava](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/fabiofava/32/5240_2.png) [@fabiofava](https://community.localwp.com/u/fabiofava)\
**Post date:** [June 6, 2025, 1:52pm UTC](https://community.localwp.com/t/enforce-ssl-on-wp-interface-with-nginx/50416/3 "2025-06-06T13:52:38Z")

</div>

Hey @Nick-B thank you for your reply

I’ve tried all possible _wp-config.php_ and _functions.php_ solutions I could find at the web, but none has worked for my sites running under _LocalWP_.

On the other hand, _wp-config.php_ solutions on _define_ works for _WP-Admin_ and _WP-Login_. My current solution is to open the _WP-Admin_ and from there select to open the site: this way it opens _https_ with a self-assigned local SSL from the browser.

I’ve also tried some _nginx conf_ options, but they also didn’t work on _LocalWP_.

I’ll keep looking forward that maybe some day this comes out. Thanks!

---

<div class="post-metadata">

**Author:** ![fabiofava](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/fabiofava/32/5240_2.png) [@fabiofava](https://community.localwp.com/u/fabiofava)\
**Post date:** [June 6, 2025, 3:04pm UTC](https://community.localwp.com/t/enforce-ssl-on-wp-interface-with-nginx/50416/4 "2025-06-06T15:04:12Z")

</div>

> [@Nick-B](#):
>
> Could you expand on anything you’ve tried or seen attempted so far that hasn’t worked? I’ve never attempted this myself, so I don’t want to provide something you’ve already tried.

I’ve tried some things to enable _GZip_ and _Browser Cache Expiry_ (copied from the very good performance premium plugin from my hosting company. But nothing they suggest for _NGinx_ has worked. And they host on _NGinx_, so they know how it works.

I can’t remember exactly, but if my mind doesn’t fail, I’ve also tried a couple suggestions (from _stackoverflow_ or something like that) to enforce SSL on _NGinx_ servers, but it also didn’t work as far as I can remember. Any suggestion?

I’m sure nowadays almost every _WordPress_ website is _SSL/HTTPS2_.

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [June 9, 2025, 2:14pm UTC](https://community.localwp.com/t/enforce-ssl-on-wp-interface-with-nginx/50416/5 "2025-06-09T14:14:00Z")

</div>

With WP sites, one important part of getting HTTPS working across the board is to update the domain in the database so that it’s using https. You can do this using a terminal by clicking “Site Overview \> Site Shell” and within the terminal that opens running this command:

```shell
wp search-replace 'http://mysite.local' 'https://mysite.local'

```

Note that you need single quotes and that the first domain is the search (with regular `http`) and the second string is the replacement (with secure `https`)

If the domains in the DB aren’t changed, then WP will always output whatever domain is set in it’s DB.

---

<div class="post-metadata">

**Author:** ![fabiofava](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/fabiofava/32/5240_2.png) [@fabiofava](https://community.localwp.com/u/fabiofava)\
**Post date:** [June 9, 2025, 3:27pm UTC](https://community.localwp.com/t/enforce-ssl-on-wp-interface-with-nginx/50416/6 "2025-06-09T15:27:39Z")

</div>

Hey @ben.turner thanks for getting back!

I’ve done it on the 2 sites I currently have on Local. On the first 2 changes were done and nothing happened, so it continues to load http instead. On the second, loads of changes have been done and then I’ve had a lot of errors at frontend:

 ![errors](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/7/1/716e7ab92406dcaf608a020b1c68ab6864425fdf.png)

I’ve rolled-back to my last backup (nothing else was change since then), so no troubles here. It really loaded https but with all those visual (non-fatal) errors. WP-Debug is DISABLED and screen of them also DISABLED on wp-config.

Any light that could help me? Maybe I should change only specific tables on WP? I’m not a great coder or PHP adminer, but I can do things and restore as they don’t work. Thank you if you can help me debugging that.

Cheers!
