#RequestHeader set X-Forwarded-Proto https\r
#RequestHeader set X-Forwarded-Port 443\r
\r
+# If you are using subdomain proxying then you will want to tell Gitblit the appropriate\r
+# context path for your repository url.\r
+# If you are not using subdomain proxying, then ignore this setting.\r
+#RequestHeader set X-Forwarded-Context /\r
+\r
#ProxyPass /gitblit ajp://localhost:8009/gitblit\r
%ENDCODE% \r
**Please** make sure to: \r
\r
#### additions\r
\r
+- added support for X-Forwarded-Context for Apache subdomain proxy configurations (issue 135)\r
- delete branch feature (issue 121, Github/ajermakovics)\r
- added line links to blob view at the expense of zebra striping (issue 130)\r
- added RedmineUserService (github/mallowlabs)\r
}\r
}\r
\r
+ String context = request.getContextPath();\r
+ String forwardedContext = request.getHeader("X-Forwarded-Context");\r
+ if (forwardedContext != null) {\r
+ forwardedContext = request.getHeader("X_Forwarded_Context");\r
+ }\r
+ if (!StringUtils.isEmpty(forwardedContext)) {\r
+ context = forwardedContext;\r
+ }\r
+ \r
+ // trim any trailing slash\r
+ if (context.length() > 0 && context.charAt(context.length() - 1) == '/') {\r
+ context = context.substring(1);\r
+ }\r
+ \r
StringBuilder sb = new StringBuilder();\r
sb.append(scheme);\r
sb.append("://");\r
|| ("https".equals(scheme) && port != 443)) {\r
sb.append(":" + port);\r
}\r
- sb.append(request.getContextPath());\r
+ sb.append(context);\r
return sb.toString();\r
}\r
}\r