From 6518d02dfc81120a62168db55af2360c88bf5a54 Mon Sep 17 00:00:00 2001 From: Greg Kempe Date: Thu, 10 Aug 2023 15:27:07 +0200 Subject: [PATCH] Fix API url, and ensure building absolute urls uses https --- peachjam/settings.py | 2 ++ peachjam_api/urls_public.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/peachjam/settings.py b/peachjam/settings.py index 6f7ad0e3d..f35b0603b 100644 --- a/peachjam/settings.py +++ b/peachjam/settings.py @@ -493,6 +493,8 @@ SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies" SESSION_COOKIE_SECURE = True +# nginx sets this header to indicate if the upstream request was secure +SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") # Caches if DEBUG: diff --git a/peachjam_api/urls_public.py b/peachjam_api/urls_public.py index 1d2bb4e55..411279c54 100644 --- a/peachjam_api/urls_public.py +++ b/peachjam_api/urls_public.py @@ -17,5 +17,5 @@ urlpatterns = [ # public-facing API - path("v1/", include(router.urls)), + path("", include(router.urls)), ]