Configure VSCode SFTP for deploying static websites to production servers. Provides complete workflow including production-ready Nginx configuration templates with security headers, caching strategies, and performance optimizations.
Identify the static files to deploy:
dist/, build/, or public/ output directoriespackage.json or documentationAsk the user for deployment details:
/var/www/sitename)VSCode Extension: This skill uses the code-sftp extension by Satiro Marra.
Before creating sftp.json, set up SSH host alias in ~/.ssh/config for better management:
Host project-prod
HostName 82.157.29.215
User root
Port 22
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
ServerAliveInterval 60
ServerAliveCountMax 3
Benefits of SSH config:
Section for 'IP' not found)ssh project-prod
Check if ~/.ssh/config already has the server:
cat ~/.ssh/config | grep -A 5 "82.157.29.215"
If found, use that existing host alias. If not, add a new entry.
Create .vscode/sftp.json using the template from assets/sftp.json.template.
Essential configuration fields:
name: Profile name for easy identificationhost: SSH host alias (e.g., "Tencent_Pro") or IP addressprotocol: "sftp" for SFTP (secure) or "ftp" for FTPport: 22 for SFTP, 21 for FTPusername: SSH/FTP usernameprivateKeyPath: Path to SSH private key (e.g., /Users/username/.ssh/id_rsa)remotePath: Remote directory path (e.g., /var/www/sitename)uploadOnSave: false recommended (manual sync is safer)Optional advanced fields:
ignore: Array of files/folders to exclude from uploadwatcher: File watching configuration for auto-uploadsyncOption: Sync behavior (delete, update, skip existing files)useTempFile: Use temporary files during uploaddownloadOnOpen: Auto-download files when openedCustomize for the project:
{{HOST_ALIAS}} with SSH config alias (recommended) or IP address{{PLACEHOLDERS}} with actual valuesignore array (.claude, nginx.conf, build artifacts, etc.)uploadOnSave: false, sync manually after builduploadOnSave: true for instant deploymentChoose the appropriate template:
assets/nginx-static.conf.template for primary websiteassets/nginx-subdomain.conf.template for subdomains like slides.example.com
Customize the configuration:
{{DOMAIN}} with actual domain name{{DOCUMENT_ROOT}} with remote path (e.g., /var/www/aiseed)Include essential features from references/nginx-best-practices.md:
Generate a deployment checklist based on assets/deploy-checklist.md:
Initial setup (one-time):
SFTP: Config to create .vscode/sftp.json
ssh user@host
ssh user@host "mkdir -p /var/www/sitename"
ssh user@host "chmod 755 /var/www/sitename"
File deployment:
npm run build)SFTP: Sync Local → Remote to upload all filesssh user@host "ls -la /var/www/sitename"
Nginx configuration:
/etc/nginx/sites-available/
ln -s /etc/nginx/sites-available/site.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
SSL/TLS setup (if not configured):
references/ssl-security.md for certificate setupcertbot --nginx -d example.com
Verification:
curl -I https://example.com
Update project documentation (README.md or CLAUDE.md) with:
/var/www/path).vscode/sftp.json)Explain to users why static + SFTP deployment is advantageous:
Static + SFTP deployment is not appropriate when:
ssh-config.md - SSH config file setup and best practices (host aliases, jump hosts, security)nginx-best-practices.md - Comprehensive Nginx optimization guide for static sitesssl-security.md - SSL/TLS certificate setup and security configurationsftp.json.template - VSCode SFTP configuration template (array format, uses SSH host alias)nginx-static.conf.template - Main domain Nginx configuration templatenginx-subdomain.conf.template - Subdomain Nginx configuration templatedeploy-checklist.md - Step-by-step deployment verification checklist