diff --git a/docs/config_flags.md b/docs/config_flags.md index c1b8a6b..52b0cfb 100644 --- a/docs/config_flags.md +++ b/docs/config_flags.md @@ -23,6 +23,7 @@ The following flags are a list of all the currently supported options that can b | WEBROOT | Change the default webroot directory from `/var/www/html` to your own setting | | ERRORS | Set to 1 to display PHP Errors in the browser | | HIDE_NGINX_HEADERS | Disable by setting to 0, default behaviour is to hide nginx + php version in headers | +| PHP_CATCHALL | Enable a 404 catch all to `index.php` -- changes `=404` on `try_files` to `/index.php?$args` | | PHP_MEM_LIMIT | Set higher PHP memory limit, default is 128 Mb | | PHP_POST_MAX_SIZE | Set a larger post_max_size, default is 100 Mb | | PHP_UPLOAD_MAX_FILESIZE | Set a larger upload_max_filesize, default is 100 Mb | diff --git a/scripts/start.sh b/scripts/start.sh index 04e789b..13e3dab 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -24,6 +24,12 @@ else webroot=/var/www/html fi +# Enables 404 pages through php index +if [ ! -z "$PHP_CATCHALL" ]; then + sed -i 's#try_files $uri $uri/ =404;#try_files $uri $uri/ /index.php?$args;#g' /etc/nginx/sites-available/default.conf +fi + + # Setup git variables if [ ! -z "$GIT_EMAIL" ]; then git config --global user.email "$GIT_EMAIL" @@ -165,7 +171,7 @@ if [[ "$ENABLE_XDEBUG" == "1" ]] ; then else echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > $XdebugFile # Note, single arrow to overwrite file. echo "xdebug.remote_enable=1 " >> $XdebugFile - echo "remote_host=host.docker.internal" >> $XdebugFile + echo "xdebug.remote_host=host.docker.internal" >> $XdebugFile echo "xdebug.remote_log=/tmp/xdebug.log" >> $XdebugFile echo "xdebug.remote_autostart=false " >> $XdebugFile # I use the xdebug chrome extension instead of using autostart # NOTE: xdebug.remote_host is not needed here if you set an environment variable in docker-compose like so `- XDEBUG_CONFIG=remote_host=192.168.111.27`.