Skip to content

Instantly share code, notes, and snippets.

@ngbala6
Last active March 1, 2022 13:18
Show Gist options
  • Select an option

  • Save ngbala6/0f961a5977599e4fb6c2a343bd36d32b to your computer and use it in GitHub Desktop.

Select an option

Save ngbala6/0f961a5977599e4fb6c2a343bd36d32b to your computer and use it in GitHub Desktop.
upstream ws-backend {
server <your local ip eg. 192.168.6.418:12345>; # this should be your application running in ip and port
}
server {
listen 9000 ssl; # this port will listen, if you don't have ssl, remove ssl word
server_name <domain name or ip eg. 192.168.6.418 or example.bala.com>;
ssl_certificate /home/bala/ssl2buy/bala.crt; # comment it, if you don't have ssl_certificate (i.e .crt file)
ssl_certificate_key /home/bala/ssl2buy/bala.key; # comment it, if you don't have ssl_certificate_key (i.e .key file)
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # comment it, if you don't have ssl
ssl_ciphers HIGH:!aNULL:!MD5; # comment it, if you don't have ssl
client_max_body_size 100M; # It allows files below 100Mb, change it based on your use
location / {
proxy_pass http://ws-backend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment