- Changed VAPID subject from public URL to mailto format - Updated docker-compose.yml to use mailto:admin@littleshop.local - Removed dependency on thebankofdebbie.giize.com public domain - All push notifications now work through VPN (admin.dark.side) only - Added update-push-internal.sh helper script for deployment - Improved security by keeping all admin traffic internal Push notifications will continue working normally through FCM, but all configuration and management stays on the internal network. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.7 KiB
Plaintext
50 lines
1.7 KiB
Plaintext
# Public-facing push notification proxy
|
|
# This runs on port 443 with SSL and ONLY exposes push endpoints
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name push.srv1002428.hstgr.cloud; # Or use a real domain
|
|
|
|
# SSL configuration (you'll need to set up Let's Encrypt)
|
|
ssl_certificate /etc/nginx/ssl/cert.pem;
|
|
ssl_certificate_key /etc/nginx/ssl/key.pem;
|
|
|
|
# Security headers
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
|
|
# CORS headers for push notifications
|
|
add_header 'Access-Control-Allow-Origin' 'https://admin.dark.side' always;
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
|
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization' always;
|
|
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
|
|
|
# Only allow specific push-related endpoints
|
|
location ~ ^/(api/push|service-worker\.js|manifest\.json) {
|
|
proxy_pass http://localhost:5100;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Host $host;
|
|
proxy_cache_bypass $http_upgrade;
|
|
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;
|
|
}
|
|
|
|
# Block everything else
|
|
location / {
|
|
return 403;
|
|
}
|
|
}
|
|
|
|
# Redirect HTTP to HTTPS for push domain
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name push.srv1002428.hstgr.cloud;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|