Skip to content

Commit

Permalink
community: fix the acme redirect templating madness
Browse files Browse the repository at this point in the history
  • Loading branch information
Firefishy committed Feb 7, 2025
1 parent ad7ef69 commit 54d0b9b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cookbooks/community/templates/default/web_only.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,6 @@ hooks:
cmd:
- sudo -H -E -u discourse cp /shared/feeds/update-feeds.atom public/update-feeds.atom
after_ssl:
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: /listen 80;/
to: |
listen 80;
listen [::]:80;
rewrite ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 permanent;

- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: /add_header.+/
Expand All @@ -133,3 +125,11 @@ hooks:
resolver <%= @resolvers.join(" ") %>;
resolver_timeout 5s;
ssl_dhparam /shared/ssl/dhparam.pem;

run:
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: /return 301.+/
to: |
rewrite ^/\.well-known/acme-challenge/(.*)$ http://acme.openstreetmap.org/.well-known/acme-challenge/$1 permanent;
return 301 https://$$ENV_DISCOURSE_HOSTNAME$request_uri;

0 comments on commit 54d0b9b

Please sign in to comment.