My os x nginx configuration
First, to install nginx do this :
sudo port install nginx
then use this configuration – this is only for testing, with setting for my os x (for access log / pids). It also use proxy to merb
# nginx using macports installation
# for my local testing
user kusno staff;
worker_processes 1;
pid /opt/local/var/run/nginx.pid;
error_log /opt/local/var/log/nginx/error.log info;
events {
worker_connections 16;
}
http {
include etc/nginx/mime.types;
default_type application/octet-stream;
access_log /opt/local/var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;
client_max_body_size 100m;
upstream merb {
server 127.0.0.1:4000;
}
server {
listen 80;
server_name localhost;
root /Users/kusno/ezify/public;
index index.html index.htm;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
#if (-f $request_filename/index.html) {
# rewrite (.*) $1/index.html break;
#}
#if (-f $request_filename.html) {
# rewrite (.*) $1.html break;
#}
if (-f $request_filename) {
rewrite (.*) $1 break;
}
if (!-f $request_filename) {
proxy_pass http://merb;
break;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
use this to restart nginx :
sudo launchctl stop org.macports.nginx sudo launchctl start org.macports.nginx
Tags: nginx
Recent Links Tagged With "launchctl" - JabberTags 8:35 pm on November 9, 2008 Permalink
[...] popular public links >> launchctl How to install apache, php, mysql with macport in Mac OS X Saved by macpete on Sun 09-11-2008 My os x nginx configuration Saved by ani625 on Sun 09-11-2008 Using launchctl on Mac OS X (10.5.2) Saved by cjcreighton on Wed 05-11-2008 Macでgonzui その2 Saved by JeffRamnani on Fri 31-10-2008 A diffrent background for each desktop in Leopard Spaces Saved by finney75 on Wed 22-10-2008 How to remove the iPhone Configuration Web Utility from your mac Saved by Narutofan44 on Fri 17-10-2008 Installing nginx and PHP with FastCGI on Mac OS X 10.5 (Leopard) Saved by shieken on Mon 13-10-2008 Installing the basic mailserver on Leopard Saved by raijsr on Sat 20-9-2008 CouchDB on MacOSX Leopard Saved by fac51 on Mon 08-9-2008 WTF?!? I’m getting so pissed at Launchd Saved by CommanderDK on Mon 01-9-2008 [...]