diff --git a/backend/bookinn/settings.py b/backend/bookinn/settings.py index 46ca3b2..be6f1dd 100644 --- a/backend/bookinn/settings.py +++ b/backend/bookinn/settings.py @@ -65,6 +65,11 @@ ALLOWED_HOSTS = ["*"] +CSRF_TRUSTED_ORIGINS = [ + "http://localhost:8000", + "http://127.0.0.1:8000", +] + INSTALLED_APPS = [ "django.contrib.admin", "django.contrib.auth", diff --git a/infra/docker-compose.yaml b/infra/docker-compose.yaml index 6997a89..438c3a2 100644 --- a/infra/docker-compose.yaml +++ b/infra/docker-compose.yaml @@ -8,8 +8,7 @@ services: env_file: - ./.env backend: - build: - context: ../backend + image: dmsn/bookinn:latest restart: always volumes: diff --git a/infra/nginx/default.conf b/infra/nginx/default.conf index 9f9792f..1288aef 100644 --- a/infra/nginx/default.conf +++ b/infra/nginx/default.conf @@ -13,9 +13,12 @@ server { location / { proxy_pass http://backend:8000; - } + proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Port $server_port; + } } \ No newline at end of file