From e0dc7aa20f52f0de931481fed8c8583c3399a790 Mon Sep 17 00:00:00 2001 From: VladislavCR Date: Fri, 23 Feb 2024 13:59:10 +0300 Subject: [PATCH] fixed nginx --- infra/nginx/nginx.conf | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/infra/nginx/nginx.conf b/infra/nginx/nginx.conf index 8cff8e4..07f0a07 100644 --- a/infra/nginx/nginx.conf +++ b/infra/nginx/nginx.conf @@ -1,11 +1,7 @@ server { - listen 80; - server_tokens off; - client_max_body_size 20M; + listen 80; - root /usr/share/nginx/html; - - location /api/v1/ { + location /api/v1/ { proxy_set_header Host $http_host; proxy_pass http://backend:8000/api/v1/; } @@ -21,10 +17,9 @@ server { proxy_set_header Host $http_host; proxy_pass http://backend:8000/schema/; } - - location / { - if (!-e $request_filename){ - rewrite ^(.*)$ /index.html break; + location / { + alias /staticfiles/; + index index.html; + try_files $uri $uri/ /index.html; } - } }