Skip to content

Commit 627a078

Browse files
authored
Merge pull request #4304 from hove-io/redirect_route_schedules
Redirect route_schedules
2 parents d9fb1fb + 3dfb0eb commit 627a078

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docker/apache/jormungandr.default.conf

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
2020
RewriteRule . %1/%2 [L,PT]
2121

22+
RewriteCond %{ENV:GORMUNGANDR_URL} ^[a-zA-Z].* [NC]
23+
RewriteRule ^/(.*route_schedules.*) %{ENV:GORMUNGANDR_URL}/$1 [P]
24+
ProxyPassReverse / %{ENV:GORMUNGANDR_URL}/
25+
2226
AddOutputFilterByType DEFLATE application/json
2327

2428
CustomLog /var/log/apache2/access.log vhost_combined_timetaken

docker/run_jormungandr.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@ function show_help() {
99
Usage: ${0##*/} -m monitor-process -r max-requests
1010
-m [0|1] activate monitor-process
1111
-r max-requests before reload for jormungandr worker
12+
-g Optional: gormungandr url for route_schedules API (Example: http://gormungandr)
1213
EOF
1314
}
1415

15-
while getopts "m:r:c:h" opt; do
16+
while getopts "m:r:c:g:h" opt; do
1617
case $opt in
1718
m) monitor_processes=$OPTARG
1819
;;
1920
r) app_max_requests=$OPTARG
2021
;;
2122
c) jormun_cache_items=$OPTARG
2223
;;
24+
g) gormungandr_url=$OPTARG
25+
;;
2326
h|\?)
2427
show_help
2528
exit 1
@@ -47,6 +50,10 @@ fi
4750

4851
jormungandr_cache2="name=jormungandr,items=${jormun_cache_items}"
4952

53+
if [[ ! -z $gormungandr_url ]]
54+
then
55+
echo "export GORMUNGANDR_URL=$gormungandr_url" >> /etc/apache2/envvars
56+
fi
5057
# run apache2
5158
service apache2 start
5259
if [ $? == 1 ]

0 commit comments

Comments
 (0)