diff --git a/SAS/LSMR/docker/lsmr-testenv/lsmr_testenv_Dockerfile b/SAS/LSMR/docker/lsmr-testenv/lsmr_testenv_Dockerfile index dde6329fc17e4f85cd8cbf1be79382ca204bf96b..8db68fe28470486ff29716f70c07101f2398af0c 100644 --- a/SAS/LSMR/docker/lsmr-testenv/lsmr_testenv_Dockerfile +++ b/SAS/LSMR/docker/lsmr-testenv/lsmr_testenv_Dockerfile @@ -8,7 +8,8 @@ RUN yum -y groupinstall 'Development Tools' && \ yum -y install cmake log4cplus-devel python3 python3-devel python3-pip nodejs npm java && \ npm install -g npx && \ npm install -g n && \ - n stable + n stable && \ + npm install -g serve RUN echo "Installing packages for LSMR..." && \ yum -y install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm && \ @@ -60,5 +61,5 @@ ENTRYPOINT /bin/bash -c 'export VARIANT=gnucxx11_opt; \ lsmr_testdatabase & \ sleep 15 && \ lsmr & \ - cd /lofar/build/gnucxx11_opt/installed/share/www && \ - npm start' \ No newline at end of file + cd /lofar/build/gnucxx11_opt/SAS/LSMR/frontend/frontend_poc && \ + serve -s build -p 3000' \ No newline at end of file diff --git a/SAS/LSMR/docker/lsmr-testenv/nginx.conf b/SAS/LSMR/docker/lsmr-testenv/nginx.conf index c00bf984dbd5cdc0f00cc3b5648f44af7c492343..a2c8c49e6433ef094091d86cb5edd61e5be043cb 100644 --- a/SAS/LSMR/docker/lsmr-testenv/nginx.conf +++ b/SAS/LSMR/docker/lsmr-testenv/nginx.conf @@ -10,6 +10,7 @@ http { proxy_set_header Connection "upgrade"; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Fprwarded-Proto $scheme; proxy_set_header X-NginX-Proxy true; proxy_pass_request_headers on; proxy_redirect off; diff --git a/SAS/LSMR/src/lsmr/settings.py b/SAS/LSMR/src/lsmr/settings.py index 1b6c34759e8a9e4aff36dc37be6d06120174c4df..987e30c1aa28ca3c4fa423549b5bc841cb594559 100644 --- a/SAS/LSMR/src/lsmr/settings.py +++ b/SAS/LSMR/src/lsmr/settings.py @@ -213,3 +213,8 @@ USE_TZ = False # We don't want timezone support since everything is UTC anyway # https://docs.djangoproject.com/en/2.0/howto/static-files/ STATIC_URL = '/static/' + + +# Setup support for proxy headers +USE_X_FORWARDED_HOST = True +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') \ No newline at end of file diff --git a/SAS/LSMR/src/lsmr/urls.py b/SAS/LSMR/src/lsmr/urls.py index 339f3c18485b8c5a56025f04937afa7e4492bb28..93ebe4c3034a1a3ed739f535aea8137bb0a65efe 100644 --- a/SAS/LSMR/src/lsmr/urls.py +++ b/SAS/LSMR/src/lsmr/urls.py @@ -16,6 +16,7 @@ Including another URLconf from django.contrib import admin from django.urls import path, re_path +from django.conf.urls import url, include from django.views.generic.base import TemplateView from rest_framework import routers, permissions @@ -44,11 +45,12 @@ swagger_schema_view = get_schema_view( ) urlpatterns = [ - path('api/admin/', admin.site.urls), - path('api/docs/', include_docs_urls(title='LSMR API')), + url(r'^', include('api.urls')), + path('admin/', admin.site.urls), + path('docs/', include_docs_urls(title='LSMR API')), re_path(r'^swagger(?P<format>\.json|\.yaml)$', swagger_schema_view.without_ui(cache_timeout=0), name='schema-json'), - path('api/swagger/', swagger_schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), - path('api/redoc/', swagger_schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), + path('swagger/', swagger_schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), + path('redoc/', swagger_schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), ]