-
-
Save wolegis/1659786ded9128935f638ee2bf228906 to your computer and use it in GitHub Desktop.
Nextcloud sample configuration for Apache HTTPD when using a dedicated hostname for Nextcloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName nextcloud.example.com | |
Alias /.well-known/acme-challenge/ /srv/http/acme | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/ | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L] | |
</VirtualHost> | |
<VirtualHost *:443> | |
ServerName nextcloud.example.com | |
SSLEngine on | |
SSLCertificateFile "/path/to/your/chain" | |
SSLCertificateKeyFile "/path/to/your/privatekey" | |
Protocols h2 http/1.1 | |
# HTTP Strict Transport Security (mod_headers is required) (63072000 seconds) | |
Header always set Strict-Transport-Security "max-age=63072000" | |
CustomLog "/var/log/httpd/access/nextcloud.log" common | |
DocumentRoot /usr/share/webapps/nextcloud | |
DirectoryIndex index.php index.html | |
<Directory /usr/share/webapps/nextcloud> | |
Require all granted | |
AllowOverride All | |
Options FollowSymLinks MultiViews | |
</Directory> | |
<IfModule mod_dav.c> | |
Dav off | |
</IfModule> | |
<FilesMatch \.php$> | |
SetHandler "proxy:unix:/run/php-fpm-legacy/nextcloud.sock|fcgi://nextcloud/" | |
</FilesMatch> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment