wordpress and nextcloud examples
This commit is contained in:
parent
0b73018865
commit
9ff210bed8
49
examples/nextcloud/docker-compose.yml
Normal file
49
examples/nextcloud/docker-compose.yml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
mywww:
|
||||||
|
image: bunkerity/bunkerized-nginx
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
- 443:443
|
||||||
|
volumes:
|
||||||
|
- ./nc-files:/www
|
||||||
|
- ./letsencrypt:/etc/letsencrypt
|
||||||
|
- ./server-confs:/server-confs # custom nginx confs at server context to make Nextcloud working
|
||||||
|
- ./modsec-crs-confs:/modsec-crs-confs # custom Core Rule Set confs to add Nextcloud exclusions
|
||||||
|
environment:
|
||||||
|
- SERVER_NAME=www.website.com # replace with your domain
|
||||||
|
- AUTO_LETS_ENCRYPT=yes
|
||||||
|
- REDIRECT_HTTP_TO_HTTPS=yes
|
||||||
|
- DISABLE_DEFAULT_SERVER=yes
|
||||||
|
- MAX_CLIENT_SIZE=10G
|
||||||
|
- REMOTE_PHP=mync
|
||||||
|
- REMOTE_PHP_PATH=/var/www/html
|
||||||
|
- LIMIT_REQ_RATE=40r/s
|
||||||
|
- LIMIT_REQ_BURST=60
|
||||||
|
- ALLOWED_METHODS=GET|POST|HEAD|PROPFIND|DELETE|PUT
|
||||||
|
|
||||||
|
mync:
|
||||||
|
image: nextcloud:stable-fpm
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./nc-files:/var/www/html
|
||||||
|
environment:
|
||||||
|
- MYSQL_HOST=mydb
|
||||||
|
- MYSQL_DATABASE=nc
|
||||||
|
- MYSQL_USER=user
|
||||||
|
- MYSQL_PASSWORD=db-user-pwd # replace with a stronger password (must match MYSQL_PASSWORD)
|
||||||
|
|
||||||
|
mydb:
|
||||||
|
image: mariadb
|
||||||
|
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./db-data:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=db-root-pwd # replace with a stronger password
|
||||||
|
- MYSQL_DATABASE=nc
|
||||||
|
- MYSQL_USER=user
|
||||||
|
- MYSQL_PASSWORD=db-user-pwd # replace with a stronger password (must match MYSQL_PASSWORD)
|
||||||
7
examples/nextcloud/modsec-crs-confs/nextcloud.conf
Normal file
7
examples/nextcloud/modsec-crs-confs/nextcloud.conf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
SecAction \
|
||||||
|
"id:900130,\
|
||||||
|
phase:1,\
|
||||||
|
nolog,\
|
||||||
|
pass,\
|
||||||
|
t:none,\
|
||||||
|
setvar:tx.crs_exclusions_nextcloud=1"
|
||||||
42
examples/nextcloud/server-confs/nextcloud.conf
Normal file
42
examples/nextcloud/server-confs/nextcloud.conf
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
location / {
|
||||||
|
rewrite ^ /index.php;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
|
||||||
|
set $path_info $fastcgi_path_info;
|
||||||
|
try_files $fastcgi_script_name =404;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $path_info;
|
||||||
|
fastcgi_param HTTPS on;
|
||||||
|
fastcgi_param modHeadersAvailable true;
|
||||||
|
fastcgi_param front_controller_active true;
|
||||||
|
fastcgi_pass mync:9000;
|
||||||
|
fastcgi_intercept_errors on;
|
||||||
|
fastcgi_request_buffering off;
|
||||||
|
include fastcgi.conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
|
||||||
|
try_files $uri/ =404;
|
||||||
|
index index.php;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
|
||||||
|
try_files $uri /index.php$request_uri;
|
||||||
|
add_header Cache-Control "public, max-age=15778463";
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {
|
||||||
|
try_files $uri /index.php$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
46
examples/wordpress/docker-compose.yml
Normal file
46
examples/wordpress/docker-compose.yml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
mywww:
|
||||||
|
image: bunkerity/bunkerized-nginx
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
- 443:443
|
||||||
|
volumes:
|
||||||
|
- ./wp-files:/www
|
||||||
|
- ./letsencrypt:/etc/letsencrypt
|
||||||
|
- ./server-confs:/server-confs # custom confs at server context for permalinks
|
||||||
|
- ./modsec-crs-confs:/modsec-crs-confs # custom Core Rule Set confs to add Wordpress exclusions
|
||||||
|
environment:
|
||||||
|
- SERVER_NAME=www.website.com # replace with your domain
|
||||||
|
- AUTO_LETS_ENCRYPT=yes
|
||||||
|
- REDIRECT_HTTP_TO_HTTPS=yes
|
||||||
|
- DISABLE_DEFAULT_SERVER=yes
|
||||||
|
- MAX_CLIENT_SIZE=50m
|
||||||
|
- REMOTE_PHP=mywp
|
||||||
|
- REMOTE_PHP_PATH=/var/www/html
|
||||||
|
|
||||||
|
mywp:
|
||||||
|
image: wordpress:fpm-alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./wp-files:/var/www/html
|
||||||
|
environment:
|
||||||
|
- WORDPRESS_DB_HOST=mydb
|
||||||
|
- WORDPRESS_DB_NAME=wp
|
||||||
|
- WORDPRESS_DB_USER=user
|
||||||
|
- WORDPRESS_DB_PASSWORD=db-user-pwd # replace with a stronger password (must match MYSQL_PASSWORD)
|
||||||
|
- WORDPRESS_TABLE_PREFIX=prefix_ # best practice : replace with a random prefix
|
||||||
|
|
||||||
|
mydb:
|
||||||
|
image: mariadb
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./db-data:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=db-root-pwd # replace with a stronger password
|
||||||
|
- MYSQL_DATABASE=wp
|
||||||
|
- MYSQL_USER=user
|
||||||
|
- MYSQL_PASSWORD=db-user-pwd # replace with a stronger password (must match WORDPRESS_DB_PASSWORD)
|
||||||
7
examples/wordpress/modsec-crs-confs/wordpress.conf
Normal file
7
examples/wordpress/modsec-crs-confs/wordpress.conf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
SecAction \
|
||||||
|
"id:900130,\
|
||||||
|
phase:1,\
|
||||||
|
nolog,\
|
||||||
|
pass,\
|
||||||
|
t:none,\
|
||||||
|
setvar:tx.crs_exclusions_wordpress=1"
|
||||||
4
examples/wordpress/server-confs/permalinks.conf
Normal file
4
examples/wordpress/server-confs/permalinks.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
location / {
|
||||||
|
index index.php index.html index.htm;
|
||||||
|
try_files $uri $uri/ /index.php?$args;
|
||||||
|
}
|
||||||
5
examples/wordpress/web-files/index.php
Normal file
5
examples/wordpress/web-files/index.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
echo "Hello World!";
|
||||||
|
|
||||||
|
?>
|
||||||
Loading…
x
Reference in New Issue
Block a user