Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions docs/guides/gettingStarted/nginxDomainConfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ title: '域名及SSL证书配置'
sidebar_position: 8
---



# 域名及SSL证书配置
# 域名及 SSL 证书配置

## 1. 前置条件 🛠️

Expand Down Expand Up @@ -120,6 +118,16 @@ server {
chunked_transfer_encoding off;
proxy_pass http://minio_s3_2/;
}

location ^~/im_open_rtc/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1:17880;
}

}

#Take the domain name "admin.xx.xx" for example
Expand Down Expand Up @@ -200,6 +208,7 @@ server {
```

## 3. Minio 配置 🗄️

- **源码部署**: 修改 `config/minio.yml` 文件中的 `externalAddress` 为 `"https://web.your_domain.com/im-minio-api"`.
- **Docker 部署**: 修改 `.env` 文件中的 `MINIO_EXTERNAL_ADDRESS` 为 `"https://web.your_domain.com/im-minio-api"`.

Expand All @@ -209,14 +218,12 @@ server {

## 5. 登录验证 🔍

- 访问IM web端:`web.your_domain.com`
- 访问 IM web 端:`web.your_domain.com`
- 访问管理后台:`admin.your_domain.com`

## 6. 修改客户端 SDK 初始化参数

在客户端 SDK 中,配置初始化参数如下:

- `apiAddr`: `https://your_domain.com/api`
- `wsAddr`: `wss://your_domain.com/msg_gateway`



Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# Nginx Domain Configuration

### 1. Prerequisites
>(1) Successful startup of open-im-server and chat (configuration of minio in open-im-server needs to be changed, refer to Step 3)

>(2) Successful installation of Nginx (including SSL module)
> (1) Successful startup of open-im-server and chat (configuration of minio in open-im-server needs to be changed, refer to Step 3)

> (2) Successful installation of Nginx (including SSL module)

>(3) Successful application for two SSL certificates: test-web.rentsoft.cn, test-admin.rentsoft.cn
> (3) Successful application for two SSL certificates: test-web.rentsoft.cn, test-admin.rentsoft.cn

>(4) Ports 443 and 80 are open
> (4) Ports 443 and 80 are open

### 2. Domain Configuration Reference

Taking the Nginx installation directory **/usr/local** as an example,
create a **config.conf** file in the **/usr/local/nginx** directory, paste the following template into the **/usr/local/nginx/config.conf** file,
and import the newly created config.conf file into the general configuration file **/usr/local/nginx/nginx.conf**
>tips: Pay attention to replacing the domain names, SSL certificate paths, and SSL keys in the domain configuration template

> tips: Pay attention to replacing the domain names, SSL certificate paths, and SSL keys in the domain configuration template

```
#open-im-server chat Corresponding deployment address and port
Expand Down Expand Up @@ -114,6 +118,15 @@ server {
chunked_transfer_encoding off;
proxy_pass http://minio_s3_2/;
}

location ^~/im_open_rtc/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1:17880;
}
}

# Take the domain name "test-admin.rentsoft.cn" for example
Expand Down Expand Up @@ -193,6 +206,7 @@ server {
```

### 3. Minio Configuration

Open **open-im-server/config/config.yaml**, modify the corresponding Minio content, and restart open-im-server.

```yaml
Expand All @@ -209,10 +223,13 @@ signEndpoint: "https://test-web.rentsoft.cn/im-minio-api" //10005
```

### 4. Starting Nginx

Navigate to the **/usr/local/nginx/sbin** directory and execute the following command:

> ./nginx -s reload

### 5. Using the Corresponding Domain Names for Login Verification
>IM: test-web.rentsoft.cn

>Admin Backend: test-admin.rentsoft.cn
> IM: test-web.rentsoft.cn

> Admin Backend: test-admin.rentsoft.cn