Created
April 5, 2012 15:41
-
-
Save pblittle/2312023 to your computer and use it in GitHub Desktop.
Cloud Foundry router - nginx config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user www-data; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 2048; | |
use epoll; | |
# multi_accept on; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
access_log /var/log/nginx/access.log; | |
log_format main '$host - [$time_local] ' | |
'"$request" $status $bytes_sent ' | |
'"$http_referer" "$http_user_agent" ' | |
'$remote_addr response_time:$upstream_response_time'; | |
default_type text/html; | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 75 20; | |
gzip on; | |
gzip_min_length 1250; | |
gzip_buffers 16 8k; | |
gzip_comp_level 2; | |
gzip_proxied any; | |
gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
gzip_vary on; | |
gzip_disable "MSIE [1-6]\.(?!.*SV1)"; | |
client_max_body_size 256M; | |
upstream vcap_router { | |
server unix:/tmp/router.sock; | |
} | |
server { | |
listen *:80; | |
server_name _; | |
access_log /home/ubuntu/cloudfoundry/.deployments/router/sys/log/vcap.access.log main; | |
server_name_in_redirect off; | |
location / { | |
proxy_buffering off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real_IP $remote_addr; | |
proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded_Proto http; | |
proxy_redirect off; | |
proxy_connect_timeout 10; | |
proxy_send_timeout 30; | |
proxy_read_timeout 30; | |
proxy_pass http://vcap_router; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment