Created
October 7, 2010 16:54
-
-
Save warwickp/615445 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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; | |
} | |
} |
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
Thanks to Jonathan and Miguel for the inspiration: http://jpluscplusm.com/blog/2010/07/06/hosting-a-chef-webui-and-api-behind-the-same-ip-port-and-ssl-certificate/