nginx

Nginx のインストール

CentOS 5.6 に tarball からインストールする。 $ wget http://nginx.org/download/nginx-1.0.9.tar.gz $ tar zxvf nginx-1.0.9.tar.gz $ cd nginx-1.0.9 $ ./configure --prefix=/usr/local/nginx-1.0.9 --with-http_ssl_module $ make $ sudo make install…

nginx -> thin で 504 Gateway Time-out

thin 側で時間が掛かる処理をする場合、往々にしてこうなります。nginx 側のデフォルト設定は概ね60秒なので、proxy 関係の timeout 設定時間を変更して上げる必要があります。 send_timeout 300; proxy_connect_timeout 300; proxy_send_timeout 300; proxy…

nginx の logrotate

「ローテーションするスクリプト書いて、cronで回す」か、「logrotateに任せる」かのどちらか。スクリプト各場合は以下の通り。 $ mv access.log access.log.0 $ kill -USR1 cat master.nginx.pid $ sleep 1 $ gzip access.log.0 # do something with access…