|
| 1 | +server { |
| 2 | + listen 80; |
| 3 | + |
| 4 | + server_name jruby.org; |
| 5 | + |
| 6 | + root /data/jruby.org; |
| 7 | + |
| 8 | + access_log /var/log/engineyard/nginx/jruby.access.log main; |
| 9 | + error_log /var/log/engineyard/nginx/jruby.error.log notice; |
| 10 | + |
| 11 | + include /etc/nginx/common/servers.conf; |
| 12 | + |
| 13 | + location /repo/ { |
| 14 | + alias /home/git/repositories/; |
| 15 | + |
| 16 | + set $repo ""; |
| 17 | + if ($request_uri ~ ^/repo/([^/]+)\.git/) { |
| 18 | + set $repo $1.git; |
| 19 | + } |
| 20 | + if ($repo = "") { |
| 21 | + return 404; |
| 22 | + } |
| 23 | + if (!-f /home/git/repositories/$repo/git-daemon-export-ok) { |
| 24 | + return 404; |
| 25 | + } |
| 26 | + } |
| 27 | + |
| 28 | + location /git { |
| 29 | + fastcgi_pass 127.0.0.1:7000; |
| 30 | + |
| 31 | + fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; |
| 32 | + fastcgi_param QUERY_STRING $query_string; |
| 33 | + |
| 34 | + fastcgi_param REQUEST_METHOD $request_method; |
| 35 | + fastcgi_param CONTENT_TYPE $content_type; |
| 36 | + fastcgi_param CONTENT_LENGTH $content_length; |
| 37 | + fastcgi_param REQUEST_URI $request_uri; |
| 38 | + fastcgi_param DOCUMENT_URI $document_uri; |
| 39 | + fastcgi_param DOCUMENT_ROOT $document_root; |
| 40 | + fastcgi_param SERVER_PROTOCOL $server_protocol; |
| 41 | + fastcgi_param GATEWAY_INTERFACE CGI/1.1; |
| 42 | + fastcgi_param SERVER_SOFTWARE nginx; |
| 43 | + fastcgi_param REMOTE_ADDR $remote_addr; |
| 44 | + fastcgi_param REMOTE_PORT $remote_port; |
| 45 | + fastcgi_param SERVER_ADDR $server_addr; |
| 46 | + fastcgi_param SERVER_PORT $server_port; |
| 47 | + fastcgi_param SERVER_NAME $server_name; |
| 48 | + } |
| 49 | + |
| 50 | + location /apidocs { |
| 51 | + include /etc/nginx/common/proxy.conf; |
| 52 | + |
| 53 | + if ($request_uri ~ ^/apidocs$) { |
| 54 | + rewrite ^/apidocs$ /apidocs/ redirect; |
| 55 | + } |
| 56 | + |
| 57 | + if (!-f $request_filename) { |
| 58 | + rewrite ^/apidocs/(.*)$ /job/jruby-dist/javadoc/$1; |
| 59 | + proxy_pass http://hudson_upstream; |
| 60 | + break; |
| 61 | + } |
| 62 | + } |
| 63 | + |
| 64 | + location / { |
| 65 | + if ($http_accept ~* application/x-thor-template) { |
| 66 | + rewrite ^/$ /rails3.rb break; |
| 67 | + } |
| 68 | + index index.html; |
| 69 | + if (-f $request_filename) { |
| 70 | + break; |
| 71 | + } |
| 72 | + if (-f $request_filename.html) { |
| 73 | + rewrite ^(.+)$ $1.html last; |
| 74 | + } |
| 75 | + } |
| 76 | +} |
| 77 | + |
| 78 | +server { |
| 79 | + listen 80; |
| 80 | + |
| 81 | + server_name wiki.jruby.org; |
| 82 | + |
| 83 | + root /data/hello_world/current/public; |
| 84 | + |
| 85 | + access_log /var/log/engineyard/nginx/jruby.access.log main; |
| 86 | + error_log /var/log/engineyard/nginx/jruby.error.log notice; |
| 87 | + |
| 88 | + include /etc/nginx/common/servers.conf; |
| 89 | + |
| 90 | + location / { |
| 91 | + set $id ''; |
| 92 | + if ($uri = '/') { |
| 93 | + set $id Home; |
| 94 | + } |
| 95 | + rewrite ([^/]*)$ http://kenai.com/projects/jruby/pages/$1$id?nav=off; |
| 96 | + } |
| 97 | +} |
| 98 | + |
| 99 | +server { |
| 100 | + listen 80; |
| 101 | + |
| 102 | + server_name bugs.jruby.org; |
| 103 | + |
| 104 | + root /data/hello_world/current/public; |
| 105 | + |
| 106 | + access_log /var/log/engineyard/nginx/jruby.access.log main; |
| 107 | + error_log /var/log/engineyard/nginx/jruby.error.log notice; |
| 108 | + |
| 109 | + include /etc/nginx/common/servers.conf; |
| 110 | + |
| 111 | + location / { |
| 112 | + set $id ''; |
| 113 | + if ($uri ~* JRUBY-([0-9]+)) { |
| 114 | + set $id -$1; |
| 115 | + } |
| 116 | + if ($uri ~ ([0-9]+)) { |
| 117 | + set $id -$1; |
| 118 | + } |
| 119 | + rewrite ^ http://jira.codehaus.org/browse/JRUBY$id; |
| 120 | + } |
| 121 | +} |
0 commit comments