Skip to content

Instantly share code, notes, and snippets.

@warwickp
Created October 7, 2010 16:54
Show Gist options
  • Save warwickp/615445 to your computer and use it in GitHub Desktop.
Save warwickp/615445 to your computer and use it in GitHub Desktop.
http {
...
#local chef server
upstream chef_api_local {
server localhost:4000;
}
#local chef webui
upstream chef_webui_local {
server localhost:4040;
}
...
}
server {
server_name yourchefserver.gymsock.org;
ssl on;
ssl_certificate /etc/ssl/gymsock.crt;
ssl_certificate_key /etc/ssl/gymsock.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;
}
}
@warwickp
Copy link
Author

warwickp commented Oct 7, 2010

@sjoerdmulder
Copy link

Just a issue i found: I got errors when uploading a cookbook using this... Had to add: proxy_set_header X-Forwarded-Proto $scheme; to make this work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment