# 我无法将 http 重定向到 https

**URL:** https://meta.discourse.org/t/i-can-not-redirect-http-to-https/202151
**Category:** Support
**Created:** [2021年八月30日 18:25 UTC](https://meta.discourse.org/t/i-can-not-redirect-http-to-https/202151 "2021-08-30T18:25:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cmdntd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmdntd/32/192008_2.png) [@cmdntd](https://meta.discourse.org/u/cmdntd)
#### Post date: [2021年八月30日 18:25 UTC](https://meta.discourse.org/t/i-can-not-redirect-http-to-https/202151/1 "2021-08-30T18:25:26Z")

</div>

您好，

我使用 **OpenLiteSpeed** ，并通过 **Docker 配合反向代理** 安装 Discourse。

我无法强制将 HTTP 重定向到 HTTPS，我已尝试以下所有方法：

1. 在管理后台启用 `force https`
2. 配置 app.yml

```plaintext
- replace:
     filename: "/etc/nginx/conf.d/discourse.conf"
     from: /server.+{/
     to: |
       server {
         if ($http_x_forwarded_proto = 'http') {
          return 301 https://$host$request_uri;
         }

```

1. 配置 .htaccess 进行重定向

您能帮我解决此问题吗？
