From 9d1e0bfaae2d25ae45bba951d5fe3753d9ee1583 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Mon, 28 Nov 2022 17:15:38 +0100 Subject: [PATCH] Update wp path Signed-off-by: Bensuperpc --- docker-compose.yml | 10 +++++----- nginx-conf-cert/wordpress.conf | 10 +++++++--- nginx-conf/wordpress.conf | 10 +++++++--- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1ccb35d..b15a868 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: - "80:80" - "443:443" volumes: - - wordpress:/var/www/html + - wordpress:/var/www/worpress - jellyfin:/var/www/jellyfin - ./nginx-conf:/etc/nginx/conf.d - certbot-cert:/etc/letsencrypt:ro @@ -133,11 +133,11 @@ services: - certbot volumes: - certbot-cert:/etc/letsencrypt - - wordpress:/var/www/html + - wordpress:/var/www/worpress - jellyfin:/var/www/jellyfin - #command: certonly --email bensuperpc@bensuperpc.fr --agree-tos --rsa-key-size 4096 --no-eff-email --verbose --noninteractive --staging --webroot --webroot-path=/var/www/html --domain bensuperpc.org --domain www.bensuperpc.org --webroot-path=/var/www/jellyfin --domain jellyfin.bensuperpc.org --domain www.jellyfin.bensuperpc.org - #command: certonly --email bensuperpc@bensuperpc.fr --agree-tos --rsa-key-size 4096 --no-eff-email --verbose --force-renewal --webroot --webroot-path=/var/www/html --domain bensuperpc.org --domain www.bensuperpc.org --webroot-path=/var/www/jellyfin --domain jellyfin.bensuperpc.org --domain www.jellyfin.bensuperpc.org - command: certonly --email bensuperpc@bensuperpc.fr --agree-tos --rsa-key-size 4096 --no-eff-email --verbose --noninteractive --keep-until-expiring --webroot --webroot-path=/var/www/html --domain bensuperpc.org --domain www.bensuperpc.org --webroot-path=/var/www/jellyfin --domain jellyfin.bensuperpc.org --domain www.jellyfin.bensuperpc.org + #command: certonly --email bensuperpc@bensuperpc.fr --agree-tos --rsa-key-size 4096 --no-eff-email --verbose --noninteractive --staging --webroot --webroot-path=/var/www/worpress --domain bensuperpc.org --domain www.bensuperpc.org --webroot-path=/var/www/jellyfin --domain jellyfin.bensuperpc.org --domain www.jellyfin.bensuperpc.org + #command: certonly --email bensuperpc@bensuperpc.fr --agree-tos --rsa-key-size 4096 --no-eff-email --verbose --force-renewal --webroot --webroot-path=/var/www/worpress --domain bensuperpc.org --domain www.bensuperpc.org --webroot-path=/var/www/jellyfin --domain jellyfin.bensuperpc.org --domain www.jellyfin.bensuperpc.org + command: certonly --email bensuperpc@bensuperpc.fr --agree-tos --rsa-key-size 4096 --no-eff-email --verbose --noninteractive --keep-until-expiring --webroot --webroot-path=/var/www/worpress --domain bensuperpc.org --domain www.bensuperpc.org --webroot-path=/var/www/jellyfin --domain jellyfin.bensuperpc.org --domain www.jellyfin.bensuperpc.org phpmyadmin: image: phpmyadmin:5.2.0 container_name: phpmyadmin diff --git a/nginx-conf-cert/wordpress.conf b/nginx-conf-cert/wordpress.conf index bf2a475..47b9d3c 100644 --- a/nginx-conf-cert/wordpress.conf +++ b/nginx-conf-cert/wordpress.conf @@ -6,11 +6,11 @@ server { index index.php index.html index.htm; - root /var/www/html; + root /var/www/wordpress; location ~ /.well-known/acme-challenge { allow all; - root /var/www/html; + root /var/www/wordpress; } location / { @@ -23,7 +23,11 @@ server { fastcgi_pass wordpress:9000; fastcgi_index index.php; include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + + # Necessary to avoid 404 error when changing the wordpress path + #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; } diff --git a/nginx-conf/wordpress.conf b/nginx-conf/wordpress.conf index 53077f0..1f8a546 100644 --- a/nginx-conf/wordpress.conf +++ b/nginx-conf/wordpress.conf @@ -16,7 +16,7 @@ server { location ~ /.well-known/acme-challenge { allow all; - root /var/www/html; + root /var/www/worpress; } location / { @@ -30,7 +30,7 @@ server { listen [::]:443 ssl http2; server_name bensuperpc.org www.bensuperpc.org wordpress.bensuperpc.org www.wordpress.bensuperpc.org; - root /var/www/html; + root /var/www/worpress; index index.php index.html index.htm; # Keepalive for 70 seconds @@ -109,7 +109,11 @@ server { fastcgi_pass wordpress_server; fastcgi_index index.php; include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + + # Necessary to avoid 404 error when changing the wordpress path + #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_intercept_errors on;