Skip to content

Commit e4c2bc5

Browse files
committed
fix: fixed nginx routing & made build reload nginx
1 parent 899d286 commit e4c2bc5

2 files changed

Lines changed: 5 additions & 18 deletions

File tree

‎scripts/build.sh‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ echo "[trickfire-docs] Build started at $(date)"
99

1010
cd "$REPO_DIR"
1111

12-
# Pull latest framework code (src/, scripts/, package.json, etc.)
13-
# content/ is gitignored and managed by sync jobs — git pull won't touch it.
1412
git pull --ff-only origin main
15-
16-
# Install/update deps if the lock file changed
1713
pnpm install --frozen-lockfile
18-
19-
# Build Docusaurus site
2014
pnpm website:build
2115

16+
sudo cp "$REPO_DIR/scripts/nginx.conf" /etc/nginx/sites-available/trickfire-docs
17+
sudo nginx -t
18+
sudo nginx -s reload
19+
2220
echo "[trickfire-docs] Build complete at $(date)"
2321
echo "[trickfire-docs] Output: $REPO_DIR/build/"

‎scripts/nginx.conf‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,19 @@
1-
# TrickFire Robotics Docs — nginx config
2-
# TLS is handled by the Cloudflare tunnel; nginx only listens on localhost.
3-
#
4-
# Copy to: /etc/nginx/sites-available/trickfire-docs
5-
# Enable: ln -s /etc/nginx/sites-available/trickfire-docs /etc/nginx/sites-enabled/
6-
# Test: nginx -t
7-
# Reload: nginx -s reload
8-
91
server {
102
listen 127.0.0.1:80;
113
server_name localhost;
124

135
root /home/trickfire/docs/build;
146
index index.html;
157

16-
# Docusaurus SPA routing
178
location / {
18-
try_files $uri $uri/ $uri.html /index.html;
9+
try_files $uri $uri/index.html $uri.html /index.html;
1910
}
2011

21-
# Immutable cache for content-hashed static assets
2212
location ~* \.(js|css|woff2|woff|ttf|png|svg|ico)$ {
2313
expires 1y;
2414
add_header Cache-Control "public, immutable";
2515
}
2616

27-
# Short cache for HTML pages
2817
location ~* \.html$ {
2918
expires 1h;
3019
add_header Cache-Control "public, must-revalidate";

0 commit comments

Comments
 (0)