Files
nextcloud/Containers/apache/nextcloud.conf
T
2026-08-08 22:36:39 +02:00

76 lines
2.3 KiB
Plaintext

Listen 8000
<VirtualHost *:8000>
ServerName localhost
# Add error log
CustomLog /proc/self/fd/1 proxy
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
ErrorLog /proc/self/fd/2
ErrorLogFormat "[%t] [%l] [%E] [client: %{X-Forwarded-For}i] [%M] [%{User-Agent}i]"
LogLevel ${AIO_LOG_LEVEL}
# PHP match
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://${NEXTCLOUD_HOST}:9000"
</FilesMatch>
<Proxy "fcgi://${NEXTCLOUD_HOST}:9000" flushpackets=on>
</Proxy>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:Accept-Encoding} br
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}.br -s
RewriteRule ^ %{REQUEST_URI}.br [END]
</IfModule>
<IfModule mod_mime.c>
AddEncoding br .br
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(css|js|mjs|svg|ico)\.br$">
<If "%{QUERY_STRING} =~ /(^|&)v=/">
Header set Cache-Control "max-age=15778463, immutable"
</If>
<Else>
Header set Cache-Control "max-age=15778463"
</Else>
</FilesMatch>
</IfModule>
# Nextcloud dir
DocumentRoot /var/www/html/
<Directory /var/www/html/>
Options FollowSymLinks MultiViews
Require all granted
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
# Deny access to .ht files
<Files ".ht*">
Require all denied
</Files>
# See https://httpd.apache.org/docs/current/en/mod/core.html#limitrequestbody
LimitRequestBody ${APACHE_MAX_SIZE}
# See https://httpd.apache.org/docs/current/mod/core.html#timeout
Timeout ${APACHE_MAX_TIME}
# See https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxytimeout
ProxyTimeout ${APACHE_MAX_TIME}
# See https://httpd.apache.org/docs/current/mod/mod_reqtimeout.html
# Disable body rate limit so that large uploads on slow connections are not aborted.
# The Timeout directive above still applies as the overall I/O timeout.
<IfModule reqtimeout_module>
RequestReadTimeout header=20-40,MinRate=500 body=0
</IfModule>
# See https://httpd.apache.org/docs/trunk/mod/core.html#traceenable
TraceEnable Off
</VirtualHost>