# vim: set filetype=nginx nofoldenable: # Configuration for the GROS visualiation site. location ~ ^/login { return 403; } # Handle visualizations from Jenkins. The job name must start with # "build-" and the remainder is the name in the URL path. The job is # a multibranch pipeline job which generates an HTML report for the # master branch, using the publishHTML post build step from the HTML # Publisher plugin, with the name "Visualization" and an index page of # index.html. location ~ ^/(sprint-report|timeline|leaderboard|collaboration-graph|process-flow|heatmap|bigboat-status|backlog-burndown)(/|\.zip) { if ($branch = "") { set $branch "master"; } rewrite ^/(?P[^/]+)/$ /job/build-$name/job/$branch/Visualization/index.html break; rewrite ^/(?P[^/]+)/(?P.+) /job/build-$name/job/$branch/Visualization/$file break; # ZIP download only available from Jenkins directly for now. rewrite ^/(?P[^/]+)\.zip$ /job/build-$name/job/$branch/Visualization/*zip*/$name.zip break; proxy_pass http://$jenkins:8080; } location ~ ^/encrypt { rewrite ^/encrypt /auth/encrypt.py break; proxy_pass https://control.gros.test; proxy_ssl_verify on; proxy_ssl_trusted_certificate wwwgros.crt; add_header Access-Control-Allow-Origin *; } location ~ ^/access { rewrite ^/access /auth/access.py break; proxy_pass https://control.gros.test; proxy_ssl_verify on; proxy_ssl_trusted_certificate wwwgros.crt; add_header Access-Control-Allow-Origin *; } location ~ ^/analytics { set_real_ip_from 192.168.0.0/16; real_ip_header X-Forwarded-For; real_ip_recursive on; allow 192.168.0.0/16; deny all; root /srv/goaccess-report; autoindex on; access_log /var/log/nginx/analytics_access.log; } rewrite ^/view / permanent; rewrite ^/job / permanent; rewrite ^/(?P[_0-9a-zA-Z-]+)$ /$name/ permanent; proxy_intercept_errors on; error_page 401 /401.html; error_page 403 /403.html; error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location ~ ^/(manifest\.js|vendor\.js|navbar\.css|fonts/) { if ($branch = "") { set $branch "master"; } add_header Access-Control-Allow-Origin *; rewrite ^/(?P.+) /job/build-visualization-site/job/$branch/Visualization/$file break; proxy_pass http://$jenkins:8080; } location ~ ^/ { if ($branch = "") { set $branch "master"; } rewrite ^/(?P.+) /job/build-visualization-site/job/$branch/Visualization/$file break; rewrite ^/ /job/build-visualization-site/job/$branch/Visualization/index.html break; proxy_pass http://$jenkins:8080; }