Revert "FIX: Ensure that log files exists in mounted directory."
[discourse_docker.git] / templates / web.onion.template.yml
CommitLineData
fdb98cf7
RP
1# Adds another server on port 80 for hidden service hosting
2
3run:
4 - exec:
5 cmd:
6 # Check DISCOURSE_ONION variable has been configured
7 - if [ -z "$DISCOURSE_ONION" ]; then echo "DISCOURSE_ONION ENV variable is required and has not been set."; exit 1; fi
8
9 - exec:
10 cmd:
11 # Copy default nginx file
12 - "cp $home/config/nginx.sample.conf /etc/nginx/conf.d/onion.conf"
13
14 # Remove duplicate entries that would crash the server
15 - replace:
16 filename: "/etc/nginx/conf.d/onion.conf"
17 from: /upstream[^\}]+\}/m
18 to: ""
19
20 - replace:
21 filename: "/etc/nginx/conf.d/onion.conf"
22 from: /map[^\}]+\}/m
23 to: ""
24
25 - replace:
26 filename: "/etc/nginx/conf.d/onion.conf"
27 from: /types[^\}]+\}/m
28 to: ""
29
30 - replace:
31 filename: "/etc/nginx/conf.d/onion.conf"
32 from: /proxy_cache_path.*$/
33 to: ""
34
35 - replace:
36 filename: "/etc/nginx/conf.d/onion.conf"
37 from: /log_format.*$/
38 to: ""
39
40 - replace:
41 filename: "/etc/nginx/conf.d/onion.conf"
42 from: /server_name.+$/
43 to: server_name $$ENV_DISCOURSE_ONION;
44
45 # Apply the same replacements done on web.template.yml to the nginx file
46 - replace:
47 filename: "/etc/nginx/conf.d/onion.conf"
48 from: /client_max_body_size.+$/
49 to: client_max_body_size $upload_size ;