From 30a99ace33441b573b2b3f82200cd559337cbff9 Mon Sep 17 00:00:00 2001 From: mortezaei Date: Mon, 19 Jan 2026 16:18:31 +0330 Subject: [PATCH] Add Nginx configuration files for dovoodi and imamjavad services --- nginx/dovodi.conf | 22 +++++++++++++++------- nginx/imamjavad.conf | 30 ++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/nginx/dovodi.conf b/nginx/dovodi.conf index 8723321..d260ba4 100644 --- a/nginx/dovodi.conf +++ b/nginx/dovodi.conf @@ -1,7 +1,7 @@ server { listen 80; - # listen 443 ssl; - server_name dovodi.newhorizonco.uk dovoodi.newhorizonco.uk; + listen 443 ssl; + server_name dovoodi.nwhco.ir; # ssl_certificate /etc/nginx/certs/nwhco.pem; # ssl_certificate_key /etc/nginx/certs/nwhco.key; # include /etc/nginx/options-ssl-nginx.conf; @@ -81,7 +81,6 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; - # 🔥 CRITICAL: Forward Authorization header for Token authentication proxy_set_header Authorization $http_authorization; proxy_pass_header Authorization; @@ -111,11 +110,21 @@ server { # ========== Static & Media Files ========== location /static/ { - alias /home/app/web/imam_javad_static/static/; + alias /home/app/web/imam_javad_staticfiles/; + expires 30d; + add_header Cache-Control "public, immutable"; } - location /media/ { - alias /home/app/web/imam_javad_static/media/; + location /media/{ + alias /home/app/web/imam_javad_mediafiles/; + + expires 30d; + add_header Cache-Control "public, immutable"; + + # Enable CORS for media files + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods "GET, OPTIONS"; + add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"; } # ========== Next.js Frontend ========== @@ -130,7 +139,6 @@ server { add_header Cache-Control "public, immutable"; } - # ⚠️ این باید آخرین location باشد (fallback) location / { proxy_pass http://88.99.212.243:7227; client_max_body_size 1200M; diff --git a/nginx/imamjavad.conf b/nginx/imamjavad.conf index 6abc51d..81501bf 100644 --- a/nginx/imamjavad.conf +++ b/nginx/imamjavad.conf @@ -1,6 +1,10 @@ server { listen 80; +<<<<<<< HEAD # listen 443 ssl; +======= + listen 443 ssl; +>>>>>>> a1b3ddf (Add Nginx configuration files for dovoodi and imamjavad services) server_name imamjavad.nwhco.ir imamjavad.newhorizonco.uk; # ssl_certificate /etc/nginx/certs/nwhco.pem; # ssl_certificate_key /etc/nginx/certs/nwhco.key; @@ -81,7 +85,10 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; +<<<<<<< HEAD # 🔥 CRITICAL: Forward Authorization header for Token authentication +======= +>>>>>>> a1b3ddf (Add Nginx configuration files for dovoodi and imamjavad services) proxy_set_header Authorization $http_authorization; proxy_pass_header Authorization; @@ -120,12 +127,32 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } +<<<<<<< HEAD location /static/ { alias /home/app/web/imam_javad_static/static/; } location /media/ { alias /home/app/web/imam_javad_static/media/; +======= + + location /static/ { + alias /home/app/web/imam_javad_staticfiles/; + expires 30d; + add_header Cache-Control "public, immutable"; + } + + location /media/{ + alias /home/app/web/imam_javad_mediafiles/; + + expires 30d; + add_header Cache-Control "public, immutable"; + + # Enable CORS for media files + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods "GET, OPTIONS"; + add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"; +>>>>>>> a1b3ddf (Add Nginx configuration files for dovoodi and imamjavad services) } # ========== Next.js Frontend ========== @@ -140,7 +167,10 @@ server { add_header Cache-Control "public, immutable"; } +<<<<<<< HEAD # ⚠️ این باید آخرین location باشد (fallback) +======= +>>>>>>> a1b3ddf (Add Nginx configuration files for dovoodi and imamjavad services) location / { proxy_pass http://88.99.212.243:7226; client_max_body_size 1200M;