82 lines
2.0 KiB
Plaintext
82 lines
2.0 KiB
Plaintext
# Storefront
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name kikomiko.ir;
|
|
|
|
root /var/www/kikomiko/dist;
|
|
index index.html;
|
|
|
|
# Block access to anything outside the public storefront tree
|
|
location ~ /\. { deny all; }
|
|
|
|
location = /fa { return 301 /$is_args$args; }
|
|
location ~ ^/fa/(.*)$ { return 301 /$1$is_args$args; }
|
|
|
|
# One shared PDP template — every catalog slug (incl. future imports) hydrates here
|
|
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";
|
|
}
|
|
|
|
# Byte ranges for scroll-driven hero video
|
|
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";
|
|
}
|
|
|
|
# Not implemented yet on this export
|
|
location /api/ { return 503; }
|
|
location /i/ { return 404; }
|
|
|
|
error_page 404 /404.html;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name www.kikomiko.ir;
|
|
return 301 http://kikomiko.ir$request_uri;
|
|
}
|
|
|
|
# Admin CMS (proxied to local Python; use HTTPS via certbot)
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name admin.kikomiko.ir;
|
|
|
|
client_max_body_size 12m;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8090;
|
|
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;
|
|
}
|
|
}
|