Skip to content

Instantly share code, notes, and snippets.

@daneko
Created November 4, 2012 15:15
Show Gist options
  • Save daneko/4012247 to your computer and use it in GitHub Desktop.
Save daneko/4012247 to your computer and use it in GitHub Desktop.
RhodeCodeを実験的に入れてみた2
upstream rc {
server 127.0.0.1:5000;
# add more instances for load balancing
#server 127.0.0.1:5001;
#server 127.0.0.1:5002;
}
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/rhodecode.access.log;
error_log /var/log/nginx/rhodecode.error.log;
# uncomment if you have nginx with chunking module compiled
# fixes the issues of having to put postBuffer data for large git
# pushes
#chunkin on;
#error_page 411 = @my_411_error;
#location @my_411_error {
# chunkin_resume;
#}
# uncomment if you want to serve static files by nginx
#root /path/to/installation/rhodecode/public;
location / {
try_files $uri @rhode;
}
location @rhode {
proxy_pass http://rc;
include /etc/nginx/proxy.conf;
}
}
# /etc/env.rhodecode
# なんかもっとカッコいい書き方があるんじゃないかな…
PBREWPATH="/usr/local/pythonbrew/pythons/Python-2.7.3/bin"
PATH="$PBREWPATH:$PATH"
PYTHONPATH="/usr/local/pythonbrew/pythons/Python-2.7.3/lib"
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Url-Scheme $scheme;
proxy_set_header X-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Proxy-host $proxy_host;
client_max_body_size 400m;
client_body_buffer_size 128k;
proxy_buffering off;
proxy_connect_timeout 7200;
proxy_send_timeout 7200;
proxy_read_timeout 7200;
proxy_buffers 8 32k;
#!/bin/sh
#/etc/rc.d/init.d/rhodecode
#
# chkconfig: 345 44 56
# description: rhodecode
. /etc/env.rhodecode
export PBREWPATH PATH PYTHONPATH
case $1 in
start)
$PBREWPATH/paster serve /home/rhodecode/production.ini start
;;
stop)
$PBREWPATH/paster serve /home/rhodecode/production.ini stop
;;
status)
$PBREWPATH/paster serve /home/rhodecode/production.ini status
;;
*)
echo "Usage: test [start|stop|status]"
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment