Skip to content
Open
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
7 changes: 7 additions & 0 deletions docs/en/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ location /uploads/ {
add_header Access-Control-Allow-Origin https://example.com; # Only allow cross-origin requests from https://example.com for enhanced security
}
```

::: warning

If all configurations are confirmed to be correct but you still cannot access the site and encounter a 403 Forbidden error, please check whether the `uploads` directory permissions are set to 755 and ensure that the owner is `www`.

:::

2. In a development environment, configure the following in `/config/autoload/server.php`:
```php
'settings' => [
Expand Down
7 changes: 7 additions & 0 deletions docs/ja/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ location /uploads/ {
add_header Access-Control-Allow-Origin https://example.com; # https://example.com ドメインのウェブページのみがこのリソースにクロスオリジンリクエストできるようにし、セキュリティ向上
}
```

::: warning

すべての設定が正しいことを確認しても、依然としてアクセスできず **403 Forbidden** が表示される場合は、`uploads` ディレクトリのパーミッションが **755** に設定されているか、所有者が `www` であるかを確認してください。

:::

2. 開発環境では、/config/autoload/server.phpに以下のように設定:
```php
'settings' => [
Expand Down
7 changes: 7 additions & 0 deletions docs/zh-hk/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ location /uploads/ {
add_header Access-Control-Allow-Origin https://example.com; # 只允許 https://example.com 域名的網頁跨域請求本資源,提升安全性
}
```

::: warning

如果已確認所有設定均正確,但仍無法訪問並出現 403 Forbidden,請檢查 `uploads` 目錄的權限是否設為 755,並確保所屬使用者為 `www`。

:::

2. 開發環境下,在/config/autoload/server.php,配置如下:
```php
'settings' => [
Expand Down
7 changes: 7 additions & 0 deletions docs/zh-tw/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ location /uploads/ {
add_header Access-Control-Allow-Origin https://example.com; # 只允許 https://example.com 域名的網頁跨域請求本資源,提升安全性
}
```

::: warning

如果已確認所有設定均正確,但仍無法訪問並出現 403 Forbidden,請檢查 `uploads` 目錄的權限是否設為 755,並確保所屬使用者為 `www`。

:::

2. 開發環境下,在/config/autoload/server.php,配置如下:
```php
'settings' => [
Expand Down
25 changes: 21 additions & 4 deletions docs/zh/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,29 @@ Swow 安装请参考 [Swow 官方文档](https://docs.toast.run/swow-blog/chs/in
```nginx
# 代理 uploads 中的图片资源
location /uploads/ {
alias /mineadmin/storage/uploads/; # 示例路径,请根据实际部署环境调整
expires 7d;
add_header Cache-Control "public"; # 允许所有用户和中间缓存服务器(如CDN)缓存此资源,提高缓存效率
add_header Access-Control-Allow-Origin https://example.com; # 只允许 https://example.com 域名的网页跨域请求本资源,提升安全性
alias /www/wwwroot/MineAdmin/storage/uploads/;
expires 30d;
add_header Cache-Control "public";
add_header Access-Control-Allow-Origin *;

# 只允许图片文件
location ~* \.(jpg|jpeg|png|gif|webp|svg|ico|bmp)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}

# 防止访问其他文件类型
location ~* \.(php|html|htm|js|css)$ {
deny all;
}
}
```
::: warning

如果确认所有配置均正确,但仍无法访问并且出现 403 Forbidden,请检查 `uploads` 目录的权限是否设置为 755,并确保所属用户为 `www`。

:::

2. 开发环境下,在/config/autoload/server.php,配置如下:
```php
'settings' => [
Expand Down
Loading