Skip to content

Commit 1f0ac26

Browse files
committed
chore(nginx): add static asset caching and fxtun.ru config
Add Cache-Control: public, immutable with 1y expiry for /assets/ and /fonts/ (safe due to Vite content hashing). Add blog lang redirects. Add nginx config for fxtun.ru Russian domain.
1 parent 635161c commit 1f0ac26

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

configs/nginx.example.conf

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,48 @@ server {
8484
ssl_protocols TLSv1.2 TLSv1.3;
8585
ssl_prefer_server_ciphers on;
8686

87+
# Blog: EN content from Hugo root output
88+
location /blog/ {
89+
alias /var/www/fxtunnel-blog/;
90+
try_files $uri $uri/ =404;
91+
expires 1h;
92+
add_header Cache-Control "public, no-transform";
93+
}
94+
95+
# /ru/blog/* → redirect to fxtun.ru/blog/*
96+
location /ru/blog/ {
97+
rewrite ^/ru(/blog/.*)$ https://fxtun.ru$1 redirect;
98+
}
99+
location = /ru/blog {
100+
return 302 https://fxtun.ru/blog/;
101+
}
102+
103+
# /en/blog/* → strip prefix, stay on fxtun.dev
104+
location /en/blog/ {
105+
rewrite ^/en(/blog/.*)$ $1 redirect;
106+
}
107+
location = /en/blog {
108+
return 302 https://fxtun.dev/blog/;
109+
}
110+
111+
# Cache static assets with content hashes (Vite build output)
112+
location /assets/ {
113+
proxy_pass http://127.0.0.1:10081;
114+
proxy_http_version 1.1;
115+
proxy_set_header Host $host;
116+
expires 1y;
117+
add_header Cache-Control "public, immutable";
118+
}
119+
120+
# Cache fonts
121+
location /fonts/ {
122+
proxy_pass http://127.0.0.1:10081;
123+
proxy_http_version 1.1;
124+
proxy_set_header Host $host;
125+
expires 1y;
126+
add_header Cache-Control "public, immutable";
127+
}
128+
87129
# Proxy to fxTunnel Web Panel
88130
location / {
89131
proxy_pass http://127.0.0.1:10081;

0 commit comments

Comments
 (0)