Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
8
Help us understand the problem. What is going on with this article?

More than 5 years have passed since last update.

@mist_dev

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

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
8
Help us understand the problem. What is going on with this article?
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
8
Help us understand the problem. What is going on with this article?