Skip to content

Commit

Permalink
Merge pull request #211 from SELab-2/development
Browse files Browse the repository at this point in the history
Network fixes
  • Loading branch information
Topvennie authored Mar 30, 2024
2 parents 0bda1d2 + 6ab8d28 commit 52fc1fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
6 changes: 3 additions & 3 deletions backend/ypovoli/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
https://docs.djangoproject.com/en/5.0/ref/settings/
"""

from django.utils.translation import gettext_lazy as _
import os
from datetime import timedelta
from os import environ
from pathlib import Path

from django.utils.translation import gettext_lazy as _

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
MEDIA_ROOT = os.path.normpath(os.path.join(BASE_DIR, "data/production"))
Expand All @@ -30,6 +31,7 @@
DEBUG = environ.get("DJANGO_DEBUG", "False").lower() in ["true", "1", "t"]
DOMAIN_NAME = environ.get("DJANGO_DOMAIN_NAME", "localhost")
ALLOWED_HOSTS = [DOMAIN_NAME]
CSRF_TRUSTED_ORIGINS = ["https://" + DOMAIN_NAME]


# Application definition
Expand All @@ -40,12 +42,10 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",

"rest_framework_swagger", # Swagger
"rest_framework", # Django rest framework
"drf_yasg", # Yet Another Swagger generator
"sslserver", # Used for local SSL support (needed by CAS)

"authentication", # Ypovoli authentication
"api", # Ypovoli logic of the base application
"notifications", # Ypovoli notifications
Expand Down
10 changes: 1 addition & 9 deletions data/nginx/nginx.prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,11 @@ http {
proxy_redirect off;
}

location /auth/ {
rewrite ^/auth/(.*)$ /$1 break;
proxy_pass http://backend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}

location / {
proxy_pass http://frontend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
}
}
}

0 comments on commit 52fc1fe

Please sign in to comment.