Skip to content

Instantly share code, notes, and snippets.

@vhdirk
Created April 8, 2012 08:17
Show Gist options
  • Save vhdirk/2335938 to your computer and use it in GitHub Desktop.
Save vhdirk/2335938 to your computer and use it in GitHub Desktop.
gitorious-unicorn.nginx
server {
listen 80;
server_name git.local;
rewrite ^(.*) https://git.local$1 permanent;
}
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/certs/myssl.crt;
ssl_certificate_key /etc/ssl/private/myssl.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
server_name git.local;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
# If you don't find the filename in the static files
# Then request it from the unicorn server
if (!-f $request_filename) {
proxy_pass http://localhost:3000;
break;
}
}
error_page 500 502 503 504 /500.html;
location = /500.html {
root /var/www/sites/gitorious/public;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment