July 2009
2 posts
wildcard nginx / passenger virtualhosts
Hosting passenger apps on nginx is easy. If they don’t need any specific webserver config, though, it’s even easier.
server {
listen 80;
server_name *.com *.com.au *.net *.org;
root /home/$host/current/public;
passenger_enabled on;
}
This is particularly useful in a development environment - just set rails_env development in the server { } block, and ghost the domain to...
restarting and refreshing local passenger apps...
Running passenger for development is great, but if you’re hacking code within a plugin then it’s cumbersome to constantly touch tmp/restart.txt and refresh your browser, even if you use tou[UP] to pick the command from your history.
Using fish and some applescript, you can do it all from your terminal by hitting ⌥R.
function reload_webkit
osascript -e 'tell application "WebKit" to...