diff --git a/README.md b/README.md index 69a2f25..dc83fe6 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ chown -R 991:991 /mnt/docker/flarum ### Custom vhost flarum nginx -File to change the vhost flarum `/etc/nginx/conf.d/custom-vhost-flarum.conf` +File to change the vhost flarum `/etc/nginx/conf.d/custom-vhost-flarum.conf` To use file custom-vhost-flarum.conf add volume `/etc/nginx/conf.d` ### Custom composer repositories diff --git a/rootfs/etc/nginx/conf.d/.gitkeep b/rootfs/etc/nginx/conf.d/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/etc/nginx/conf.d/custom-vhost-flarum.conf b/rootfs/etc/nginx/conf.d/custom-vhost-flarum.conf deleted file mode 100644 index 776c9dc..0000000 --- a/rootfs/etc/nginx/conf.d/custom-vhost-flarum.conf +++ /dev/null @@ -1,6 +0,0 @@ -# Example: - -# fix for flagrow/sitemap (https://github.com/flagrow/sitemap) -# location = /sitemap.xml { -# try_files $uri $uri/ /index.php?$query_string; -# } diff --git a/rootfs/etc/nginx/nginx.conf b/rootfs/etc/nginx/nginx.conf index 64cf628..9e04589 100644 --- a/rootfs/etc/nginx/nginx.conf +++ b/rootfs/etc/nginx/nginx.conf @@ -132,7 +132,7 @@ http { fastcgi_param REMOTE_ADDR $http_x_real_ip; } - include /etc/nginx/conf.d/custom-flarum.conf; + include /etc/nginx/conf.d/custom-vhost-flarum.conf; } diff --git a/rootfs/usr/local/bin/run.sh b/rootfs/usr/local/bin/run.sh index 1cd84bb..39c5e2c 100644 --- a/rootfs/usr/local/bin/run.sh +++ b/rootfs/usr/local/bin/run.sh @@ -64,6 +64,18 @@ if [ -f 'extensions/composer.repositories.txt' ]; then done < extensions/composer.repositories.txt fi +# Custom vhost flarum nginx +if [ ! -e '/etc/nginx/conf.d/custom-vhost-flarum.conf' ]; then + + echo '# Example: + +# fix for flagrow/sitemap (https://github.com/flagrow/sitemap) +# location = /sitemap.xml { +# try_files $uri $uri/ /index.php?$query_string; +# }' > /etc/nginx/conf.d/custom-vhost-flarum.conf + +fi + # if no installation was performed before if [ -e 'assets/rev-manifest.json' ]; then