Skip to content

Commit

Permalink
Trying reverse proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
york-stsci committed Nov 25, 2024
1 parent be1437b commit 520bc6e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jwql/website/apps/jwql/templates/explore_image.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h3>{{ file_root }}_{{ filetype }}.fits</h3>
<div class="row">
<!-- Display the image -->
<div class="col-xl-9">
<iframe id="encoder_iframe" height="75%" width="50%" src="http://{{jdaviz_host|safe}}:{{jdaviz_port|safe}}?file={{file_path|safe}}"></iframe>
<iframe id="encoder_iframe" height="75%" width="50%" src="quickview?file={{file_path|safe}}"></iframe>
</div>
</div>

Expand Down
1 change: 1 addition & 0 deletions jwql/website/jwql_proj/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'revproxy.apps.RevProxyConfig'
]

MIDDLEWARE = [
Expand Down
8 changes: 7 additions & 1 deletion jwql/website/jwql_proj/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,14 @@
"""

from django.contrib import admin
from django.urls import include, path
from django.urls import include, path, re_path
from revproxy.views import ProxyView

from ..apps.jwql import views
from jwql.utils.utils import get_config

jdaviz_host = get_config()["jdaviz"]["host"]
jdaviz_port = get_config()["jdaviz"]["port"]

# Define custom error page views
handler404 = views.not_found # Page not found
Expand All @@ -60,4 +65,5 @@
urlpatterns = [
path('', include('jwql.website.apps.jwql.urls')),
path('admin/', admin.site.urls),
path('quickview', ProxyView.as_view(upstream=f'http://{jdaviz_host}:{jdaviz_port}'))
]

0 comments on commit 520bc6e

Please sign in to comment.