← back to Kamatera Nginx
sites-available/builds.agentabrams.com
157 lines
# builds.agentabrams.com — Steve's session-builds viewer + Website Analysis app
#
# - Static MP4 viewer at /var/www/builds.agentabrams.com (existing)
# - Reverse-proxy to Mac Studio 2 over tailnet (100.65.187.120:9760) for the
# Website Analysis app routes: /website-analysis, /wa/*, /api/website-analysis,
# /api/wa/* — Mac is the source of truth, Kamatera just terminates SSL.
#
# Basic auth (admin and user, same password) gates everything.
server {
server_name builds.agentabrams.com;
access_log /var/log/nginx/builds.agentabrams.com.access.log;
error_log /var/log/nginx/builds.agentabrams.com.error.log;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
auth_basic "builds.agentabrams.com — admin only";
auth_basic_user_file /etc/nginx/.htpasswd-builds;
# ---------- Builds Index ----------
location = /builds {
proxy_pass http://100.65.187.120:9760$request_uri;
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_connect_timeout 30s;
proxy_read_timeout 60s;
}
# ---------- Website Analysis app (Mac via tailnet) ----------
# Mac is offline-tolerant: 30s connect timeout + nice 502 message.
location = /website-analysis {
proxy_pass http://100.65.187.120:9760$request_uri;
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_connect_timeout 30s;
proxy_read_timeout 60s;
}
location ^~ /wa/ {
proxy_pass http://100.65.187.120:9760$request_uri;
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_connect_timeout 30s;
proxy_read_timeout 60s;
}
location ^~ /api/website-analysis {
proxy_pass http://100.65.187.120:9760$request_uri;
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_connect_timeout 30s;
proxy_read_timeout 60s;
}
location ^~ /api/wa/ {
proxy_pass http://100.65.187.120:9760$request_uri;
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_connect_timeout 30s;
proxy_read_timeout 60s;
}
# Ship-this-rebuild lands on /biz/:slug/edit — proxy the editor + its API +
# webcam uploads through too, gated by the same basic auth.
location ^~ /biz/ {
proxy_pass http://100.65.187.120:9760$request_uri;
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;
client_max_body_size 12m;
proxy_connect_timeout 30s;
proxy_read_timeout 120s;
}
location ^~ /api/biz/ {
proxy_pass http://100.65.187.120:9760$request_uri;
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;
client_max_body_size 12m;
proxy_connect_timeout 30s;
proxy_read_timeout 120s;
}
location ^~ /uploads/ {
proxy_pass http://100.65.187.120:9760$request_uri;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# ---------- existing builds viewer (static MP4s) ----------
root /var/www/builds.agentabrams.com;
index index.html;
autoindex off;
location / {
try_files $uri $uri/ =404;
}
location ~* \.mp4$ {
auth_basic "builds.agentabrams.com — admin only";
auth_basic_user_file /etc/nginx/.htpasswd-builds;
add_header Accept-Ranges bytes;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/builds.agentabrams.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/builds.agentabrams.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
location /proxy {
proxy_pass http://localhost:9764;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffering off;
proxy_read_timeout 30s;
}
location /shopify-oauth/ {
auth_basic off;
proxy_pass http://100.65.187.120:9914/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 30s;
}
location /sister-sites/ {
proxy_pass http://localhost:9764/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
add_header Cache-Control "no-store, must-revalidate" always;
add_header Pragma "no-cache" always;
expires off;
}
}
server {
if ($host = builds.agentabrams.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name builds.agentabrams.com;
return 404; # managed by Certbot
}