Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 42494b2972
Fetching contributors…

Cannot retrieve contributors at this time

84 lines (71 sloc) 2.396 kB
worker_processes 2;
error_log /var/www/apps/application/current/log/nginx.error.log debug;
pid /var/www/apps/application/shared/pids/nginx.pid;
events {
worker_connections 1024;
}
http {
include /usr/local/nginx/conf/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/www/apps/application/current/log/nginx.access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 70;
gzip on;
gzip_min_length 1000;
gzip_buffers 4 8k;
gzip_comp_level 9;
gzip_proxied any;
gzip_types application/xml application/javascript application/x-javascript application/atom+xml application/rss+xml;
gzip_types text/css text/html text/javascript text/js text/plain text/xml;
upstream mongrel {
server 127.0.0.1:8000;
server 127.0.0.1:8001;
}
server {
listen 80;
server_name 10.3.16.62;
root /var/www/apps/application/current/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 "10.3.16.62";
proxy_redirect false;
proxy_max_temp_file_size 0;
# if static file exists serve now, skip rewrite rules
if (-f $request_filename) {
expires max;
break;
}
if (-f $request_filename/index.html) {
expires 7d;
rewrite (.*) $1/index.html break;
}
# support rails page caching
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
# pass it onto upstream mongrel cluster
if (!-f $request_filename) {
proxy_pass http://mongrel;
break;
}
}
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov).*?$ {
root current_path/public;
if (!-f $request_filename) {
proxy_pass http://mongrel;
break;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/apps/application/current/public;
}
}
}
Jump to Line
Something went wrong with that request. Please try again.