Nextcloud: WIP: Optional create hiddenservice
This commit is contained in:
parent
31fd563b47
commit
d1bcf9ec1a
7 changed files with 32 additions and 26 deletions
36
templates/apache2/apache_site.conf.j2
Normal file
36
templates/apache2/apache_site.conf.j2
Normal file
|
@ -0,0 +1,36 @@
|
|||
<Macro NCSite $domain $pool>
|
||||
<VirtualHost *:80>
|
||||
ServerName $domain
|
||||
DocumentRoot /data/nextcloud/$domain/
|
||||
Include /etc/apache2/conf-available/sao-cache.conf
|
||||
IncludeOptional {{ apache_custom_conf_path }}/$domain.conf
|
||||
ErrorLog /var/log/apache2/$domain.error
|
||||
ProxyTimeout 900
|
||||
|
||||
<IfModule proxy_fcgi_module>
|
||||
<FilesMatch ".+\.ph(ar|p|tml)$">
|
||||
SetHandler "proxy:unix:/run/php/php-fpm-$pool.sock|fcgi://$domain"
|
||||
</FilesMatch>
|
||||
<FilesMatch ".+\.phps$">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
<FilesMatch "^\.ph(ar|p|ps|tml)$">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
|
||||
<Directory {{ nextcloud_root }}/$domain/>
|
||||
Require all granted
|
||||
AllowOverride All
|
||||
Options FollowSymLinks MultiViews
|
||||
<IfModule mod_dav.c>
|
||||
Dav off
|
||||
</IfModule>
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
</Macro>
|
||||
|
||||
# Includieren der Variablen
|
||||
Include /etc/apache2/conf-available/nextcloud_sites.conf
|
||||
|
||||
UndefMacro NCSite
|
17
templates/apache2/custom.conf.j2
Normal file
17
templates/apache2/custom.conf.j2
Normal file
|
@ -0,0 +1,17 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
{% if instance.alias is defined %}
|
||||
{% for alias in instance.alias %}
|
||||
ServerAlias {{ alias }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if item.config.hiddenservice is defined and item.config.hiddenservice %}
|
||||
ServerAlias {{ hiddenservice_address.stdout }}
|
||||
|
||||
<IfModule mod_headers.c>
|
||||
<If "%{SERVER_NAME} == '{{ item.name }}'">
|
||||
Header set Onion-Location "http://{{ hiddenservice_address.stdout }}"
|
||||
</If>
|
||||
</IfModule>
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue