Skip to content

Instantly share code, notes, and snippets.

@trib0r3
Created July 23, 2025 15:55
Show Gist options
  • Save trib0r3/5e4531ef34c822424458a29d1446ec77 to your computer and use it in GitHub Desktop.
Save trib0r3/5e4531ef34c822424458a29d1446ec77 to your computer and use it in GitHub Desktop.
Working HTTPS proxy configuration for code http server
# code serve-web --port 3291 --connection-token <token>
server {
listen 443 ssl;
server_name hangar.local;
ssl_certificate /path/to/cert.crt;
ssl_certificate_key /path/to/cert.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://127.0.0.1:3291/;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_connect_timeout 60;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
add_header X-Cache $upstream_cache_status;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment