Skip to content

Instantly share code, notes, and snippets.

@joao-timescale
Created November 26, 2017 15:31
Show Gist options
  • Save joao-timescale/3353e6feacd2aa53f9ea541b88c57978 to your computer and use it in GitHub Desktop.
Save joao-timescale/3353e6feacd2aa53f9ea541b88c57978 to your computer and use it in GitHub Desktop.
Rocket.Chat Nginx Reverse Proxy
# Upstreams
upstream backend {
server 127.0.0.1:3000;
}
# HTTPS Server
server {
listen 443;
server_name your_hostname.com;
error_log /var/log/nginx/rocketchat.access.log;
ssl on;
ssl_certificate /etc/nginx/certificate.crt;
ssl_certificate_key /etc/nginx/certificate.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don’t use SSLv3 ref: POODLE
location / {
proxy_pass http://backend/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;
proxy_redirect off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment