0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Open-WebUIでPDFとかをアップロードするときにコケる問題を解決してみた。

Last updated at Posted at 2025-11-19

ことの起こり

ある日、外に公開しているOpen-WebUIにPDFをアップロードしようと思ったら、
以下のようなメッセージが出てアップロードできないことに気が付いた。
image.png

調査してみた

どうやら、NGINX等でリバースプロキシをしている環境でよく起こる事象らしい。
確かにローカルネットワークだとうまくアップロードできる。
Open-WebUIのGitHubで情報が見つかったので参考にしてみた。

設定してみる

NGINXのリバースプロキシ設定を以下のようにした。

server {
    listen [::]:443 ssl;
    listen 443 ssl;

    server_name hoge.fuga.com;

    ssl_certificate fullchain.pem;
    ssl_certificate_key privkey.pem;
    ssl_dhparam dhparam.pem;

    location / {
        proxy_pass http://<Open-WebUIのサーバIP>:<ポート>;
        client_max_body_size 20480M; # 追加
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # WebSockets
        proxy_http_version 1.1; # 追加
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_buffering off; # 追加
        proxy_read_timeout 1800s; # 追加
        proxy_send_timeout 1800s; # 追加
    }
}

結果

どうやらリバースプロキシ時にファイルのサイズオーバーもしくはタイムアウトが発生し、
ファイルが途中までしか送信されなかったため「Syntax Error」になるということらしい。

ひとまず上記設定でアップロードが正常に行われたことを確認したので一安心。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?