Compare commits
7 Commits
a1b51599c6
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc1cac8e5a | ||
|
|
5d610b9177 | ||
|
|
8096d8985b | ||
|
|
8462b10e3b | ||
|
|
6bdd8e918c | ||
|
|
44ec0a004a | ||
|
|
c403419ea1 |
18
README.md
18
README.md
@@ -162,6 +162,24 @@ docker compose exec -u www-data nextcloud php occ preview:generate-all nom_utili
|
||||
|
||||
**Note:** L'image est buildée localement et taguée `nextcloud-custom:latest`. Lors des mises à jour Nextcloud, pensez à rebuild l'image.
|
||||
|
||||
# Server Transport Traefik
|
||||
|
||||
Ajouter à traefik.yml :
|
||||
```yml
|
||||
serversTransport:
|
||||
nextcloud-transport:
|
||||
forwardingTimeouts:
|
||||
dialTimeout: 30s
|
||||
responseHeaderTimeout: 0s
|
||||
idleConnTimeout: 3600s
|
||||
```
|
||||
OU au docker-compose.yml
|
||||
```yml
|
||||
command:
|
||||
- "--serverstransport.forwardingtimeouts.dialtimeout=30s"
|
||||
- "--serverstransport.forwardingtimeouts.responseheadertimeout=0"
|
||||
- "--serverstransport.forwardingtimeouts.idleconntimeout=3600s"
|
||||
```
|
||||
### Configuration Apache pour Traefik
|
||||
|
||||
Le fichier `apache/nextcloud.conf` configure Apache pour fonctionner correctement derrière le reverse proxy Traefik.
|
||||
|
||||
16
apache/mpm_prefork.conf
Normal file
16
apache/mpm_prefork.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
# prefork MPM
|
||||
# StartServers: number of server processes to start
|
||||
# MinSpareServers: minimum number of server processes which are kept spare
|
||||
# MaxSpareServers: maximum number of server processes which are kept spare
|
||||
# ServerLimit: maximum value for MaxRequestWorkers (must be set before MaxRequestWorkers)
|
||||
# MaxRequestWorkers: maximum number of server processes allowed to start
|
||||
# MaxConnectionsPerChild: maximum number of requests a server process serves
|
||||
|
||||
<IfModule mpm_prefork_module>
|
||||
ServerLimit 400
|
||||
StartServers 10
|
||||
MinSpareServers 10
|
||||
MaxSpareServers 20
|
||||
MaxRequestWorkers 400
|
||||
MaxConnectionsPerChild 1000
|
||||
</IfModule>
|
||||
@@ -1,5 +1,10 @@
|
||||
# Configuration pour reverse proxy Traefik
|
||||
# Récupération de l'IP réelle du client via X-Forwarded-For
|
||||
ServerName cloud.agence66.fr
|
||||
|
||||
# Autoriser les caractères spéciaux encodés dans les noms de fichiers
|
||||
AllowEncodedSlashes NoDecode
|
||||
|
||||
RemoteIPHeader X-Forwarded-For
|
||||
RemoteIPTrustedProxy 172.16.0.0/12
|
||||
RemoteIPTrustedProxy 10.0.0.0/8
|
||||
|
||||
@@ -13,3 +13,6 @@ binlog_format = ROW
|
||||
|
||||
# Connections
|
||||
max_connections = 200
|
||||
|
||||
# Gros fichiers - augmenter la taille max des paquets
|
||||
max_allowed_packet = 1G
|
||||
|
||||
@@ -8,6 +8,7 @@ services:
|
||||
volumes:
|
||||
- ./data:/var/www/html
|
||||
- ./apache/nextcloud.conf:/etc/apache2/conf-enabled/nextcloud.conf:ro
|
||||
- ./apache/mpm_prefork.conf:/etc/apache2/mods-available/mpm_prefork.conf:ro
|
||||
- ./logs/apache:/var/log/apache2
|
||||
logging:
|
||||
driver: "json-file"
|
||||
@@ -32,16 +33,16 @@ services:
|
||||
- REDIS_HOST_PASSWORD=${REDIS_HOST_PASSWORD}
|
||||
# PHP
|
||||
- PHP_MEMORY_LIMIT=4096M
|
||||
- PHP_UPLOAD_MAX_FILESIZE=2G
|
||||
- PHP_POST_MAX_SIZE=2G
|
||||
- PHP_MAX_EXECUTION_TIME=1800
|
||||
- PHP_MAX_INPUT_TIME=1800
|
||||
- PHP_UPLOAD_MAX_FILESIZE=10G
|
||||
- PHP_POST_MAX_SIZE=10G
|
||||
- PHP_MAX_EXECUTION_TIME=7200
|
||||
- PHP_MAX_INPUT_TIME=7200
|
||||
# - PHP_UPLOAD_MAX_FILESIZE=1024G
|
||||
# - PHP_POST_MAX_SIZE=1024G
|
||||
# - PHP_MAX_EXECUTION_TIME=86400
|
||||
# - PHP_MAX_INPUT_TIME=86400
|
||||
# Apache
|
||||
- APACHE_BODY_LIMIT=2147483648
|
||||
- APACHE_BODY_LIMIT=0
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost/status.php"]
|
||||
interval: 30s
|
||||
@@ -55,11 +56,27 @@ services:
|
||||
networks:
|
||||
- nextcloud-net
|
||||
- traefik-net
|
||||
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
# Router configuration
|
||||
- "traefik.http.routers.cloud.rule=Host(`${NEXTCLOUD_DOMAIN}`)"
|
||||
- "traefik.http.routers.cloud.entrypoints=websecure"
|
||||
- "traefik.http.routers.cloud.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.routers.cloud.middlewares=nextcloud-headers,nextcloud-redirect"
|
||||
# Service configuration
|
||||
- "traefik.http.services.cloud.loadbalancer.server.port=80"
|
||||
- "traefik.http.services.cloud.loadbalancer.serverstransport=nextcloud-transport"
|
||||
# Middleware: Headers
|
||||
- "traefik.http.middlewares.nextcloud-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
|
||||
- "traefik.http.middlewares.nextcloud-headers.headers.customresponseheaders.Strict-Transport-Security=max-age=15552000"
|
||||
# Middleware: Redirect pour CalDAV/CardDAV
|
||||
- "traefik.http.middlewares.nextcloud-redirect.redirectregex.regex=https://(.*)/.well-known/(card|cal)dav"
|
||||
- "traefik.http.middlewares.nextcloud-redirect.redirectregex.replacement=https://$$1/remote.php/dav/"
|
||||
- "traefik.http.middlewares.nextcloud-redirect.redirectregex.permanent=true"
|
||||
redis:
|
||||
image: redis:alpine
|
||||
restart: unless-stopped
|
||||
command: redis-server --requirepass ${REDIS_HOST_PASSWORD} --maxmemory 512mb --maxmemory-policy allkeys-lru
|
||||
command: redis-server --requirepass ${REDIS_HOST_PASSWORD} --maxmemory 2gb --maxmemory-policy allkeys-lru
|
||||
networks:
|
||||
- nextcloud-net
|
||||
|
||||
|
||||
Reference in New Issue
Block a user