Skip to content

Commit

Permalink
Proxy training site instead of redirecting
Browse files Browse the repository at this point in the history
  • Loading branch information
natefoo committed Feb 8, 2019
1 parent 65cab12 commit 9e3bb08
Showing 1 changed file with 46 additions and 2 deletions.
48 changes: 46 additions & 2 deletions env/galaxy/templates/nginx/training.j2
Expand Up @@ -2,14 +2,16 @@
## This file is maintained by Ansible - CHANGES WILL BE OVERWRITTEN
##

proxy_cache_path /var/lib/nginx/proxy levels=1:2 keys_zone=s3_cache:10m max_size=128m inactive=60m; # 1.7.10 use_temp_path=off;

server {
listen *:80;
server_name training.galaxyproject.org;

access_log /var/log/nginx/training.galaxyproject.org_access.log;
error_log /var/log/nginx/training.galaxyproject.org_error.log;

return 302 https://galaxyproject.github.io/training-material$request_uri;
return 302 https://training.galaxyproject.org$request_uri;
}

server {
Expand All @@ -19,7 +21,49 @@ server {
access_log /var/log/nginx/training.galaxyproject.org_access.log;
error_log /var/log/nginx/training.galaxyproject.org_error.log;

return 302 https://galaxyproject.github.io/training-material$request_uri;
#client_max_body_size 8M;

#root /srv/nginx/training.galaxyproject.org/root;

#error_page 404 /error.html;
#error_page 403 =404 /error.html;

location /archive {
proxy_cache s3_cache;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Authorization '';
proxy_set_header Host galaxy-training.s3-website.us-east-1.amazonaws.com;
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header x-amz-meta-server-side-encryption;
proxy_hide_header x-amz-server-side-encryption;
proxy_hide_header Set-Cookie;
proxy_ignore_headers Set-Cookie;
#proxy_cache_revalidate on; # 1.5.7
#proxy_intercept_errors on;
#proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
proxy_cache_valid 200 304 60m;
add_header Cache-Control max-age=31536000;
add_header X-Cache-Status $upstream_cache_status;
proxy_pass http://galaxy-training.s3-website.us-east-1.amazonaws.com/archive;
}

location /training-material/ {
proxy_http_version 1.1;
proxy_set_header Host galaxyproject.github.io;
proxy_pass https://galaxyproject.github.io/training-material/;
}

location / {
proxy_cache s3_cache;
proxy_http_version 1.1;
proxy_set_header Host galaxyproject.github.io;
proxy_pass https://galaxyproject.github.io/training-material/;
}

#return 302 https://galaxyproject.github.io/training-material$request_uri;
}

# vim: set filetype=nginx

0 comments on commit 9e3bb08

Please sign in to comment.