Skip to content

Instantly share code, notes, and snippets.

@devkoriel
Created March 12, 2019 13:15
Show Gist options
  • Save devkoriel/8b789a65972733af7a4e7e799b49083c to your computer and use it in GitHub Desktop.
Save devkoriel/8b789a65972733af7a4e7e799b49083c to your computer and use it in GitHub Desktop.
Mattermost nginx.conf
server {
listen 80;
server_name chat.example.com;
location ~ /api/v[0-9]+/(users/)?websocket$ {
proxy_pass http://127.0.0.1:<HOST_포트>;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Origin "";
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
server_name chat.example.com;
client_max_body_size 10g;
location ~ /api/v[0-9]+/(users/)?websocket$ {
proxy_pass http://127.0.0.1:<HOST_포트>;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Origin "";
}
location / {
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:<HOST_포트>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment