# nginx example: terminate TLS in nginx and proxy to the JTL POS plain-HTTP listener. # # The Node server listens on: # PORT -> HTTPS (e.g. 4447) # HTTP_PORT -> plain HTTP (e.g. 8087) # # With this setup you only need to expose port 443 (or 4443) through nginx. # Copy this file to your nginx site config and adjust paths/ports as needed. server { listen 443 ssl; listen [::]:443 ssl; server_name pos.example.com; # Same certificate pair the Node server uses (certs/key.pem + certs/cert.pem). # For a real deployment, replace with your own cert/chain. ssl_certificate /home/strainz/src/jtlPosSync/certs/cert.pem; ssl_certificate_key /home/strainz/src/jtlPosSync/certs/key.pem; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers HIGH:!aNULL:!MD5; # The JTL POS API can send large request bodies (product/category sync). client_max_body_size 0; location / { proxy_pass http://127.0.0.1:8087; proxy_http_version 1.1; 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; # Keep alive to the Node backend. proxy_set_header Connection ""; # Longer timeouts for long-running sync requests. proxy_connect_timeout 60s; proxy_read_timeout 300s; proxy_send_timeout 300s; } } # Optional: redirect all plain-HTTP traffic to HTTPS. server { listen 80; listen [::]:80; server_name pos.example.com; return 301 https://$host$request_uri; }