Skip to content

Instantly share code, notes, and snippets.

@kirk
Created January 9, 2011 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirk/771304 to your computer and use it in GitHub Desktop.
Save kirk/771304 to your computer and use it in GitHub Desktop.
## /etc/nginx/nginx.conf
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
http {
include /etc/nginx/mime.types;
access_log /var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
#local chef-server
upstream chef_api_local {
server localhost:4000;
}
#local chef webui
upstream chef_webui_local {
server localhost:4040;
}
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
## /etc/nginx/sites-enabled/chef.my-chef-server.com
server {
server_name chef.my-chef-server.com;
ssl on;
ssl_certificate /etc/ssl/certs/myssl.crt;
ssl_certificate_key /etc/ssl/private/myssl.key;
listen 443;
root /var/www;
location / {
#API request incoming
if ( $http_x_ops_timestamp != "") {
proxy_pass http://chef_api_local;
break;
}
# webui request incoming
proxy_pass http://chef_webui_local;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment