Commit 44460d27 authored by Ryan Herbert's avatar Ryan Herbert Committed by marc duez

nginx use b as location instead of browser

redirect browser to b and add symlink /usr/share/vidjil/b to
/usr/share/vidjil/browser for the new nginx location
parent d185dd98
......@@ -199,7 +199,7 @@ PositionalUrl.prototype.parseUrlParams = function() {
var slash_params = url.pathname.substr(1).split('/');
var positional_params = [];
for (var k = 0; k < slash_params.length; k++) {
if(slash_params[k] !== 'browser' && slash_params[k] !== "index.html" && slash_params[k] !== "")
if(slash_params[k] !== 'b' && slash_params[k] !== "index.html" && slash_params[k] !== "")
positional_params.push(slash_params[k]);
}
var pos_param_keys = this.getStraightParams();
......@@ -234,7 +234,7 @@ PositionalUrl.prototype.generateParamsString = function(params_dict) {
}
PositionalUrl.prototype.pushUrl = function(params) {
var new_url = this.window.location.href.split('browser')[0] + 'browser' + params;
var new_url = this.window.location.href.split('b')[0] + 'b' + params;
console.log("new url: " + new_url);
this.window.history.pushState('plop', 'plop', new_url);
};
......
......@@ -31,6 +31,7 @@ run ln -s /etc/vidjil/nginx_gzip_static.conf /etc/nginx/conf.d/web2py/gzip_stati
run ln -s /etc/vidjil/nginx_gzip.conf /etc/nginx/conf.d/web2py/gzip.conf
run ln -s /etc/vidjil/uwsgi.conf /etc/nginx/conf.d/web2py/uwsgi.conf
run ln -s /etc/vidjil/germline.js /usr/share/vidjil/browser/js/germline.js
run ln -s /usr/share/vidjil/browser /usr/share/vidjil/b
copy ./scripts/nginx-entrypoint.sh /entrypoints/nginx-entrypoint.sh
run chown -R www-data:www-data /usr/share/vidjil
......
......@@ -42,14 +42,14 @@ server {
error_page 405 = $1;
}
location ~ ^/(client|c) {
rewrite /(client|c)(.*) /browser$2 redirect;
location ~ ^/(client|c|browser) {
rewrite /(client|c|browser)(.*)$ /b$2 redirect;
}
location /browser {
rewrite /browser/([0-9]+)/([0-9]+)(\/?) /browser/?set=$1&conf=$2 break;
rewrite /browser/([0-9/]+)/(css|js|images|test)/(.*) /browser/$2/$3 redirect;
location ~ ^/b {
root /usr/share/vidjil;
rewrite ^/b/([0-9/]+)/(css|js|images|test)/(.*) /$2/$3 redirect;
rewrite ^/b/([0-9]+)/([0-9]+)(\/?) /b/?set=$1&conf=$2 break;
expires 1h;
add_header Cache-Control must-revalidate;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment