A few years ago I wrote a php script to provide better autoindex within nginx. I used it for quite a long period until I rewrote it in Ruby/Sinatra. But then I figured the setup for it is overly complicated just for simple task. And takes additional memory. I always have php-fpm running anyway so it’s free.
And so I decided to take up the old php script and fix it up. Unfortunately there isn’t other language as easy to setup for web as php which is why I fixed it instead of rewriting in some other languages (or keeping it ruby). The “fixed” version is still pretty much imperative-style but hey, it works.
Only tested with nginx.
I’ve had this written for a while but never gotten around to do final check. So, here it is. Hopefully without any fatal mistake.
I will (by solfa feat. Chata)
あぁ 透明な一秒が 流れてゆく
aa toumei na ichibyou ga nagarete yuku
たゆたう 思い出と 少しだけまどろむ日々
tayutau omoide to sukoshi dake madoromu hibi
紡いだ 言の葉 風に舞い上がれ
tsumuida kotonoha kaze ni maiagare
ten made todoke to tsubuyaki inoru
咲き誇る 綺麗な花 色とりどり 鮮やかな光景
sakihokoru kirei na hana irotoridori azayaka na koukei
いつも 気がつけば 聴こえてくる 懐かしいメロディ
itsumo ki ga tsukeba kikoetekuru natsukashii merodi
繋いだ手 交わす誓い その想いは 繰り返すメモリー
tsunaida te kawasu chikai sono omoi wa kurikaesu memorii
いつか また出会う 運命の輪 途切れることなく 回る
itsuka mata deau unmei no wa togirerukotonaku mawaru
[ Torrent ]
[ Torrent ]
For god knows how long,
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; is one of the line usually included in nginx config snippet for proxying to a unicorn (Rails) backend.
…which is something you should never do unless you have another load balancer in front of the nginx being configured.
That line basically tells nginx to append
$remote_addr to whatever
X-Forwarded-For value currently set. It is only useful when your nginx is behind other load balancer which set up its own (hopefully correctly)
X-Forwarded-For. It should be set explicitly to
$remote_addr for any external-facing proxy. Otherwise fun things will happen.