Wiki source code of Apache2 Proxy Passing
Last modified by Normann P. Nielsen on 2013/09/19 12:47
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{toc/}} | ||
| 2 | |||
| 3 | For more about this, see: | ||
| 4 | |||
| 5 | [[http://httpd.apache.org/docs/2.2/mod/mod_proxy.html]] | ||
| 6 | |||
| 7 | [[https://confluence.atlassian.com/display/DOC/Using+Apache+with+virtual+hosts+and+mod_proxy]] | ||
| 8 | |||
| 9 | Here is my configs to pass to my Atlassian JIRA (port 8080) And Atlassian Confluence (port 8090) | ||
| 10 | |||
| 11 | === JIRA === | ||
| 12 | |||
| 13 | {{code}} | ||
| 14 | <VirtualHost *:80> | ||
| 15 | |||
| 16 | ServerAdmin bnp@mos-eisley.dk | ||
| 17 | ServerName jira.mos-eisley.dk | ||
| 18 | ServerAlias jira | ||
| 19 | ProxyPass / http://localhost:8080/ | ||
| 20 | ProxyPassReverse / http://localhost:8080/ | ||
| 21 | |||
| 22 | <Proxy *> | ||
| 23 | Order Allow,Deny | ||
| 24 | Allow from all | ||
| 25 | Deny from none | ||
| 26 | </Proxy> | ||
| 27 | |||
| 28 | </VirtualHost> | ||
| 29 | {{/code}} | ||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | === Confluence === | ||
| 34 | The "Deny from 80 10.40.62.77" is actually to stop a spammer identified from that IP Address | ||
| 35 | |||
| 36 | The ReWrite Url disables hitting the Confluence Dashboard, redirection to /display/public/ directly | ||
| 37 | |||
| 38 | |||
| 39 | {{code}} | ||
| 40 | <VirtualHost *:80> | ||
| 41 | |||
| 42 | ServerAdmin bnp@mos-eisley.dk | ||
| 43 | ServerName www.mos-eisley.dk | ||
| 44 | ServerAlias mos-eisley.dk | ||
| 45 | |||
| 46 | DocumentRoot /var/www | ||
| 47 | ErrorDocument 503 /503.html | ||
| 48 | |||
| 49 | |||
| 50 | RewriteEngine On | ||
| 51 | RewriteRule ^/dashboard.action.* /display/public/ [PT] | ||
| 52 | |||
| 53 | |||
| 54 | ProxyPass / http://localhost:8090/ | ||
| 55 | ProxyPassReverse / http://localhost:8090/ | ||
| 56 | |||
| 57 | |||
| 58 | <Proxy *> | ||
| 59 | Order Allow,Deny | ||
| 60 | Allow from all | ||
| 61 | Deny from 80 10.40.62.77 | ||
| 62 | Deny from none | ||
| 63 | </Proxy> | ||
| 64 | |||
| 65 | |||
| 66 | </VirtualHost> | ||
| 67 | |||
| 68 | {{/code}} | ||
| 69 | |||
| 70 | |||
| 71 | |||
| 72 | === Proxy passing a subpart === | ||
| 73 | If You want JIRA or Confluence to run under /jira or /docs - often interesting if [[www.site.dk>>http://www.site.dk]] has SSL enabled - the proxy part can be configured as: | ||
| 74 | |||
| 75 | |||
| 76 | {{code}} | ||
| 77 | ProxyPass /docs http://localhost:8080/docs | ||
| 78 | ProxyPassReverse /docs http://localhost:8080/docs | ||
| 79 | ProxyPass /jira http://localhost:6060/jira | ||
| 80 | ProxyPassReverse /jira http://localhost:6060/jira | ||
| 81 | |||
| 82 | {{/code}} |