1
|
# http://www.redmine.org/wiki/redmine/HowTo_configure_Nginx_to_run_Redmine
|
2
|
# http://wiki.rubyonrails.org/deployment/nginx-thin
|
3
|
# http://blog.khax.net/2010/04/01/nginx-mongrel-redmine-quick-setup-notes/
|
4
|
|
5
|
# Upstream Ruby process cluster for load balancing
|
6
|
upstream thin_cluster {
|
7
|
server unix:/tmp/thin.redmine.0.sock;
|
8
|
server unix:/tmp/thin.redmine.1.sock;
|
9
|
server unix:/tmp/thin.redmine.2.sock;
|
10
|
server unix:/tmp/thin.redmine.3.sock;
|
11
|
}
|
12
|
|
13
|
server {
|
14
|
listen 80;
|
15
|
server_name projects.whyaskwhy.org;
|
16
|
|
17
|
# access_log /var/log/nginx/redmine-proxy-access;
|
18
|
# error_log /var/log/nginx/redmine-proxy-error;
|
19
|
|
20
|
# DEBUGGING
|
21
|
# rewrite_log on;
|
22
|
# access_log /var/log/nginx/testing.access.log vhost_combined_debugging;
|
23
|
# error_log /var/log/nginx/testing.error.log debug;
|
24
|
|
25
|
include proxy.inc.conf;
|
26
|
root /var/www/whyaskwhy.org/projects;
|
27
|
proxy_redirect off;
|
28
|
|
29
|
# Send sensitive stuff via https
|
30
|
rewrite ^/redmine/login(.*) https://projects.whyaskwhy.org$request_uri permanent;
|
31
|
rewrite ^/redmine/my/account(.*) https://projects.whyaskwhy.org$request_uri permanent;
|
32
|
rewrite ^/redmine/my/password(.*) https://projects.whyaskwhy.org$request_uri permanent;
|
33
|
rewrite ^/redmine/admin(.*) https://projects.whyaskwhy.org$request_uri permanent;
|
34
|
|
35
|
location /redmine {
|
36
|
alias /opt/redmine/public/;
|
37
|
try_files $uri/index.html $uri.html $uri @cluster;
|
38
|
}
|
39
|
|
40
|
location @cluster {
|
41
|
proxy_pass http://thin_cluster;
|
42
|
}
|
43
|
}
|
44
|
|
45
|
server {
|
46
|
listen 443;
|
47
|
server_name projects.whyaskwhy.org;
|
48
|
|
49
|
# access_log /var/log/nginx/redmine-ssl-proxy-access;
|
50
|
# error_log /var/log/nginx/redmine-ssl-proxy-error;
|
51
|
|
52
|
include ssl.inc.conf;
|
53
|
|
54
|
include proxy.inc.conf;
|
55
|
proxy_redirect off;
|
56
|
root /var/www/whyaskwhy.org/projects;
|
57
|
|
58
|
# When we're back to non-sensitive things, send back to http
|
59
|
rewrite ^/redmine/$ http://projects.whyaskwhy.org$request_uri permanent;
|
60
|
rewrite ^/redmine/projects(.*) http://projects.whyaskwhy.org$request_uri permanent;
|
61
|
rewrite ^/redmine/guide(.*) http://projects.whyaskwhy.org$request_uri permanent;
|
62
|
rewrite ^/redmine/users(.*) http://projects.whyaskwhy.org$request_uri permanent;
|
63
|
rewrite ^/redmine/my/page(.*) http://projects.whyaskwhy.org$request_uri permanent;
|
64
|
rewrite ^/redmine/logout(.*) http://projects.whyaskwhy.org$request_uri permanent;
|
65
|
|
66
|
location /redmine {
|
67
|
alias /opt/redmine/public/;
|
68
|
try_files $uri/index.html $uri.html $uri @cluster;
|
69
|
}
|
70
|
|
71
|
location @cluster {
|
72
|
proxy_pass http://thin_cluster;
|
73
|
}
|
74
|
}
|