Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions templates/web.socketed.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ run:
to: |
listen unix:/shared/nginx.https.sock ssl;
set_real_ip_from unix:;
- replace:
filename: "/etc/nginx/conf.d/outlets/before-server/10-redirect-http-to-https.conf"
from: /listen 80;(\nlisten \[::\]:80;)?/
to: |
listen unix:/shared/nginx.http.sock;
set_real_ip_from unix:;
4 changes: 3 additions & 1 deletion templates/web.ssl.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ run:
listen 80;
return 301 https://$$ENV_DISCOURSE_HOSTNAME$request_uri;
}
- exec: rm /etc/nginx/conf.d/outlets/server/10-http.conf
- file:
path: "/etc/nginx/conf.d/outlets/server/10-http.conf"
contents: ""
- file:
hook: ssl
path: "/etc/nginx/conf.d/outlets/server/20-https.conf"
Expand Down
9 changes: 6 additions & 3 deletions templates/web.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,18 @@ run:
- "cp $home/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf"
- "rm /etc/nginx/sites-enabled/default"
- "mkdir -p /var/nginx/cache"
- "mkdir -p /etc/nginx/conf.d/outlets/before-server"
- "mkdir -p /etc/nginx/conf.d/outlets/server"
- "mkdir -p /etc/nginx/conf.d/outlets/discourse"

# Stop building the container if the Nginx outlets are missing
- "grep -q 'outlets/before-server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"before-server\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )"
- "grep -q 'outlets/server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"server\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )"
- "grep -q 'outlets/discourse' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"discourse\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )"

# Create placeholders for the Nginx outlets
- "mkdir -p /etc/nginx/conf.d/outlets/before-server"
- "mkdir -p /etc/nginx/conf.d/outlets/server"
- "mkdir -p /etc/nginx/conf.d/outlets/discourse"
- "touch /etc/nginx/conf.d/outlets/before-server/10-redirect-http-to-https.conf"

- replace:
filename: /etc/nginx/nginx.conf
from: pid /run/nginx.pid;
Expand Down
Loading