Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

Allow acme challenge through NGINX configuration #348

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ services:
# This directory must have cert files if you want to enable SSL
- ./volumes/web/cert:/cert:ro
- /etc/localtime:/etc/localtime:ro
- ./volumes/web/acme-challenge:/var/www/acme-challenge:ro
# Uncomment for SSL
# environment:
# - MATTERMOST_ENABLE_SSL=true
6 changes: 6 additions & 0 deletions web/mattermost
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ server {
proxy_read_timeout 600s;
proxy_pass http://{%APP_HOST%}:{%APP_PORT%};
}

location /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/acme-challenge;
rewrite /.well-known/acme-challenge/(.*)$ /$1 break;
}
}
7 changes: 7 additions & 0 deletions web/mattermost-ssl
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
server {
listen 80 default_server;
server_name _;
location / {
return 301 https://$host$request_uri;
}
location /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/acme-challenge;
rewrite /.well-known/acme-challenge/(.*)$ /$1 break;
}
}

map $http_x_forwarded_proto $proxy_x_forwarded_proto {
Expand Down