Browse Source

Add Nginx configuration files for dovoodi and imamjavad services

master
mortezaei 4 months ago
parent
commit
30a99ace33
  1. 22
      nginx/dovodi.conf
  2. 30
      nginx/imamjavad.conf

22
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;

30
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;

Loading…
Cancel
Save