<

![endif]-->

fc2ブログ

nginxで静的なトップページを表示する

http://example.com

http://example.com/
にアクセスした時はランディングページに飛ばして、それ以外はアプリケーションで動かすためのnginxの設定です。
「location = /」という記述で、上記の二つを認識できます。
server{
listen 80;
server_name example.com;
root /var/www/app/test;

location / {
proxy_pass http://sinatra;
}
location = / {
root /var/www/test/public;
index index.htm;
}
}