NGINX
A sample configuration setup on my machine
# default www: /usr/local/var/www/
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
passenger_root /usr/local/Cellar/passenger/5.0.6/libexec/lib/phusion_passenger/locations.ini;
passenger_ruby /Users/pc_name/.rvm/gems/ruby-1.9.3-p551/wrappers/ruby;
sendfile on;
keepalive_timeout 65;
server {
listen *:1234;
server_name localhost;
rack_env development;
root /usr/local/var/www/github/app_folder_name/public;
index index.html index.htm index.html.haml;
passenger_enabled on;
}
server {
listen *:1235;
server_name localhost;
rack_env development;
root /usr/local/var/www/github/app2_folder_name/public;
index index.html index.htm index.html.haml;
passenger_enabled on;
}
server {
listen 80;
server_name default_localhost;
rack_env development;
root /Users/ojvdequintos/ringadoc-web/public/;
passenger_enabled on;
location / {
root /Users/ojvdequintos/ringadoc-web/public/;
index index.html index.htm index.html.haml;
passenger_enabled on;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Sample NGINX auto-generated path during installation
brew install nginx --with-passenger
==> Downloading http://nginx.org/download/nginx-1.6.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/nginx-1.6.3.tar.gz
==> ./configure --prefix=/usr/local/Cellar/nginx/1.6.3 --with-http_ssl_module --
==> make
==> make install
==> Caveats
Docroot is: /usr/local/var/www
The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /usr/local/etc/nginx/servers/.
To activate Phusion Passenger, add this to /usr/local/etc/nginx/nginx.conf, inside the 'http' context:
passenger_root /usr/local/opt/passenger/libexec/lib/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;
To have launchd start nginx at login:
ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
Then to load nginx now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Or, if you don't want/need launchctl, you can just run:
nginx
==> Summary
�� /usr/local/Cellar/nginx/1.6.3: 7 files, 2.9M, built in 29 seconds
No comments:
Post a Comment