Help us understand the problem. What is going on with this article?

サーバへのリクエストをProxyPassでS3に流すときに502エラー

More than 5 years have passed since last update.

WebサーバにきたリクエストをS3に流そうとおもって設定をかけたところ

ProxyPass /hoge http://xxxxxx.s3-ap-northeast-1.amazonaws.com/hoge
ProxyPassReverse /hoge http://xxxxxx.s3-ap-northeast-1.amazonaws.com/hoge

error_logに時々こんなエラーが出て、502エラーで返してしまう
(全リクエストの3%くらい)

[Thu Apr 01 00:00:00 2014] [error] [client xxx.xxx.xxx.xxx] (20014)Internal error: proxy: error reading status line from remote server xxxxxx.s3-ap-northeast-1.amazonaws.com
[Thu Apr 01 00:00:00 2014] [error] [client xxx.xxx.xxx.xxx] proxy: Error reading from remote server returned by /hoge

この辺りを見ながら、proxy-initial-not-pooled を有効にすればよさそうと判断
http://lasecwww.epfl.ch/manual/ja/mod/mod_proxy_http.html
http://ttaka.dip.jp/maniax/?ReverseProxy%E3%81%AE%E8%A8%AD%E5%AE%9A

設定を以下のように修正し、502エラーが発生しなくなりました

SetEnv proxy-initial-not-pooled 1

ProxyPass /hoge http://xxxxxx.s3-ap-northeast-1.amazonaws.com/hoge
ProxyPassReverse /hoge http://xxxxxx.s3-ap-northeast-1.amazonaws.com/hoge
mist_dev
インフラ修行中。バンド活動をしている。こっそりバイク乗り。日本のビールが好き。 AWS / Ruby on Rails
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした