原文出处:http://blog.chenlb.com/2012/01/nginx-proxy-jira-and-confluence.html
jira 和 confluence 想部署到同一台机器上。都使用 80 端口访问。使用 nginx 代理吧。直接使用 proxy_pass http://127.0.0.1:8080 jira 的首页小插件不太好使。发现使用 try_files 可以。
加一个 jira_proxy.conf 文档。如:
#cd /home/admin/nginx
#vi conf/jira_proxy.conf
- proxy_connect_timeout 30s;
- proxy_send_timeout 120;
- proxy_read_timeout 120;
- proxy_buffer_size 32k;
- proxy_buffers 4 32k;
- proxy_busy_buffers_size 64k;
- proxy_redirect off;
- proxy_hide_header Vary;
- proxy_set_header Accept-Encoding '';
- proxy_set_header Host $host;
- proxy_set_header Referer $http_referer;
- proxy_set_header Cookie $http_cookie;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
nginx.conf
- server {
- listen 80;
- server_name jira.example.com;
- location / {
- try_files $uri @jira;
- }
- location @jira {
- internal;
- proxy_pass http://127.0.0.1:8080;
- include jira_proxy.conf;
- }
- }
- server {
- listen 80;
- server_name wiki.example.com;
- location / {
- try_files $uri @confluence;
- }
- location @confluence {
- internal;
- proxy_pass http://127.0.0.1:8090;
- include jira_proxy.conf;
- }
- }
try_files 真是代理的好帮手。
版本说明
nginx/1.0.10
Atlassian JIRA v4.4.4
Atlassian Confluence 4.1.2