Skip to content

Commit

Permalink
Merge branch 'dev2' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Sep 23, 2015
2 parents a96be7c + 67b298f commit a77f025
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ VOLUME ["/import"]
WORKDIR /import/
# Start RStudio
CMD /startup.sh
EXPOSE 80
7 changes: 3 additions & 4 deletions proxy.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
server {
# listen IE_PORT;
listen 80;
server_name localhost;
access_log /var/log/nginx/localhost.access.log;

# Some help from https://superuser.com/questions/689885/make-nginx-reverse-proxy-302-redirect-to-a-uri-sub-folder-instead-of-root
location ^~ /rstudio/IE_PORT/ {
location ^~ PROXY_PREFIX/rstudio/ {
add_header 'Access-Control-Allow-Origin' '*'; # IE_CORS_ORIGIN
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';

proxy_buffering off;
rewrite /rstudio/IE_PORT/(.*) /$1 break;
rewrite PROXY_PREFIX/rstudio/(.*) /$1 break;
proxy_pass http://127.0.0.1:8787;
proxy_redirect http://127.0.0.1:8787/ /rstudio/IE_PORT/;
proxy_redirect http://127.0.0.1:8787/ PROXY_PREFIX/rstudio/;
}
}
4 changes: 2 additions & 2 deletions startup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

sed -i "s| '\*'; # IE_CORS_ORIGIN| '${CORS_ORIGIN}';|" /proxy.conf;
sed -i "s/IE_PORT/${DOCKER_PORT}/" /proxy.conf;
sed -i "s|PROXY_PREFIX|${PROXY_PREFIX}|" /proxy.conf;
cp /proxy.conf /etc/nginx/sites-enabled/default

# The RStudio image starts as privileged user. The parent Galaxy server is
Expand Down Expand Up @@ -40,6 +40,6 @@ GALAXY_URL=$GALAXY_URL
" > /etc/profile.d/galaxy.sh

# Launch traffic monitor
monitor_traffic.sh &
/monitor_traffic.sh &
# And nginx in foreground mode.
nginx -g 'daemon off;'

0 comments on commit a77f025

Please sign in to comment.