<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>akanuma-hiroaki</author_name>
  <author_url>https://blog.hatena.ne.jp/akanuma-hiroaki/</author_url>
  <blog_title>Tech Blog by Akanuma Hiroaki</blog_title>
  <blog_url>https://blog.akanumahiroaki.com/</blog_url>
  <categories>
  </categories>
  <description>環境変数によってRailsアプリの動作を切り替えたいことがあって、 nginx + Passenger で動かしているRailsアプリに環境変数を渡す方法を調べました。 nginx の起動スクリプト（/etc/init.d/nginx）に書いても、 /etc/default/nginx に書いてもうまくいかなかったのですが、 nginx の設定ファイルの location ブロックで passenger_set_cgi_param で設定することで環境変数が設定できます。 passenger_set_cgi_param HOGE fuga; これでRailsアプリの中で ENV['HOGE']…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.akanumahiroaki.com%2Fentry%2F2014%2F11%2F22%2F000000_1&quot; title=&quot;RailsアプリにPassengerから環境変数を渡す - Tech Blog by Akanuma Hiroaki&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2014-11-22 00:00:00</published>
  <title>RailsアプリにPassengerから環境変数を渡す</title>
  <type>rich</type>
  <url>https://blog.akanumahiroaki.com/entry/2014/11/22/000000_1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
