Skip to content

Instantly share code, notes, and snippets.

View alexgalkin's full-sized avatar

Alex Halkin alexgalkin

View GitHub Profile
@alexgalkin
alexgalkin / nginx_proxy_socket
Created May 14, 2024 20:41
Reverse proxy configuration for SocketIO server
location /ws/ {
proxy_pass http://localhost:9000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
@alexgalkin
alexgalkin / keys-gen.sh
Created November 20, 2025 13:20
Private and Public Keys generation
# generate private key
openssl genrsa -out private_key.pem 2048
# generate public key
openssl rsa -in private_key.pem -pubout -out public_key.pem
# convert to one line for ENV variable
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' private_key.pem > private-env.txt