96 lines
2.5 KiB
Nginx Configuration File
96 lines
2.5 KiB
Nginx Configuration File
upstream kikomiko_admin {
|
|
server admin:8090;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name www.kikomiko.ir;
|
|
return 301 https://kikomiko.ir$request_uri;
|
|
}
|
|
|
|
# Storefront — kikomiko.ir
|
|
server {
|
|
listen 80;
|
|
server_name kikomiko.ir _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
location ~ /\. { deny all; }
|
|
|
|
location = /fa { return 301 /$is_args$args; }
|
|
location ~ ^/fa/(.*)$ { return 301 /$1$is_args$args; }
|
|
|
|
location /products/ {
|
|
try_files $uri $uri/ /products/index.html;
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
|
|
location /videos/ {
|
|
try_files $uri =404;
|
|
add_header Accept-Ranges bytes;
|
|
add_header Cache-Control "public, max-age=604800";
|
|
}
|
|
|
|
location /fonts/ {
|
|
try_files $uri =404;
|
|
add_header Cache-Control "public, max-age=2592000, immutable";
|
|
}
|
|
|
|
location /css/ {
|
|
try_files $uri =404;
|
|
add_header Cache-Control "public, max-age=604800";
|
|
}
|
|
|
|
location /js/ {
|
|
try_files $uri =404;
|
|
add_header Cache-Control "public, max-age=604800";
|
|
}
|
|
|
|
# Live EUR rate from TGJU (used by dist/js/fx.js). Must stay above the /api/ catch-all.
|
|
location = /api/fx/eur {
|
|
proxy_pass https://call1.tgju.org/ajax.json;
|
|
proxy_ssl_server_name on;
|
|
proxy_set_header Host call1.tgju.org;
|
|
proxy_set_header User-Agent "KikomikoFX/1.0";
|
|
add_header Cache-Control "public, max-age=300";
|
|
add_header Access-Control-Allow-Origin "*";
|
|
}
|
|
|
|
location /api/ { return 503; }
|
|
|
|
# Product photos → KIKO Eva CDN (full originals). Keep /i/{uuid} working for any leftover links.
|
|
location ~ ^/i/([0-9a-fA-F-]+)$ {
|
|
proxy_pass https://assets.joqhl8w6.on-eva.io/blob/$1;
|
|
proxy_ssl_server_name on;
|
|
proxy_set_header Host assets.joqhl8w6.on-eva.io;
|
|
add_header Cache-Control "public, max-age=604800";
|
|
}
|
|
|
|
error_page 404 /404.html;
|
|
}
|
|
|
|
# Admin — admin.kikomiko.ir
|
|
server {
|
|
listen 80;
|
|
server_name admin.kikomiko.ir admin.*;
|
|
|
|
client_max_body_size 80m;
|
|
|
|
location / {
|
|
proxy_pass http://kikomiko_admin;
|
|
proxy_http_version 1.1;
|
|
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 Cookie $http_cookie;
|
|
proxy_pass_header Set-Cookie;
|
|
}
|
|
}
|