1 # Adds another server on port 80 for hidden service hosting
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
11 # Copy default nginx file
12 - "cp $home/config/nginx.sample.conf /etc/nginx/conf.d/onion.conf"
14 # Remove duplicate entries that would crash the server
16 filename: "/etc/nginx/conf.d/onion.conf"
17 from: /upstream[^\}]+\}/m
21 filename: "/etc/nginx/conf.d/onion.conf"
26 filename: "/etc/nginx/conf.d/onion.conf"
27 from: /types[^\}]+\}/m
31 filename: "/etc/nginx/conf.d/onion.conf"
32 from: /proxy_cache_path.*$/
36 filename: "/etc/nginx/conf.d/onion.conf"
41 filename: "/etc/nginx/conf.d/onion.conf"
42 from: /server_name.+$/
43 to: server_name $$ENV_DISCOURSE_ONION;
45 # Apply the same replacements done on web.template.yml to the nginx file
47 filename: "/etc/nginx/conf.d/onion.conf"
48 from: /client_max_body_size.+$/
49 to: client_max_body_size $upload_size ;