您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

52 行
1.3KB

  1. {{ ansible_managed | comment }}
  2. <VirtualHost *:443 *:8843>
  3. ServerName {{nextcloud_server_names|first}}
  4. {% for name in nextcloud_server_names | difference([nextcloud_server_names|first]) %}
  5. ServerAlias {{name}}
  6. {% endfor %}
  7. SSLEngine on
  8. SSLCertificateFile "/etc/ssl/certs/nextcloud.cert.pem"
  9. SSLCertificateKeyFile "/etc/ssl/private/nextcloud.key.pem"
  10. {% if not certificate_provider == "selfsigned" %}
  11. SSLCertificateChainFile "/etc/ssl/certs/nextcloud.chain.pem"
  12. {% endif %}
  13. {% if certificate_provider == "letsencrypt" %}
  14. Include /etc/letsencrypt/options-ssl-apache.conf
  15. {% endif %}
  16. DocumentRoot {{nextcloud_directory}}
  17. <Directory {{nextcloud_directory}}/>
  18. Options +FollowSymlinks
  19. AllowOverride All
  20. <IfModule mod_dav.c>
  21. Dav off
  22. </IfModule>
  23. SetEnv HOME {{nextcloud_directory}}
  24. SetEnv HTTP_HOME {{nextcloud_directory}}
  25. </Directory>
  26. ErrorLog ${APACHE_LOG_DIR}/error.log
  27. CustomLog ${APACHE_LOG_DIR}/access.log combined
  28. </VirtualHost>
  29. <VirtualHost *:80>
  30. ServerName {{nextcloud_server_names|first}}
  31. {% for name in nextcloud_server_names | difference(nextcloud_server_names|first) %}
  32. ServerAlias {{name}}
  33. {% endfor %}
  34. RewriteEngine On
  35. RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
  36. </VirtualHost>