diff --git a/docs/examples/setup-phalcon.rst b/docs/examples/setup-phalcon.rst index 39319ee2..900aaa0e 100644 --- a/docs/examples/setup-phalcon.rst +++ b/docs/examples/setup-phalcon.rst @@ -170,7 +170,7 @@ By default routes will not work if using Nginx. To fix this, you will need to cr In your project folder, you will need to create a folder called .devilbox unless you changed `HTTPD_TEMPLATE_DIR` in your .env -Copy the default nginx config from ./cfg/vhost-gen/nginx.yml-example to ./data/www/my-project/.devilbox/nginx.yml +Copy the default nginx config from ./cfg/vhost-gen/nginx.yml-example-vhost to ./data/www/my-project/.devilbox/nginx.yml Carefully edit the nginx.yml file and change: diff --git a/docs/vhost-gen/customize-all-virtual-hosts-globally.rst b/docs/vhost-gen/customize-all-virtual-hosts-globally.rst index ed86ca88..8fe5298d 100644 --- a/docs/vhost-gen/customize-all-virtual-hosts-globally.rst +++ b/docs/vhost-gen/customize-all-virtual-hosts-globally.rst @@ -31,17 +31,21 @@ if you have already a specific vhost template for a project in place. In order for template files to be picked up by the web server they must be copied to their correct filename. -+----------------+--------------------------+------------------+ -| Web server | Example template | Template name | -+================+==========================+==================+ -| Apache 2.2 | ``apache22.yml-example`` | ``apache22.yml`` | -+----------------+--------------------------+------------------+ -| Apache 2.4 | ``apache24.yml-example`` | ``apache24.yml`` | -+----------------+--------------------------+------------------+ -| Nginx stable | ``nginx.yml-example`` | ``nginx.yml`` | -+----------------+--------------------------+------------------+ -| Nginx mainline | ``nginx.yml-example`` | ``nginx.yml`` | -+----------------+--------------------------+------------------+ ++----------------+--------------------------------+------------------+ +| Web server | Example template | Template name | ++================+================================+==================+ +| Apache 2.2 | ``apache22.yml-example-vhost`` | ``apache22.yml`` | ++----------------+--------------------------------+------------------+ +| Apache 2.4 | ``apache24.yml-example-vhost`` | ``apache24.yml`` | ++----------------+--------------------------------+------------------+ +| Nginx stable | ``nginx.yml-example-vhost`` | ``nginx.yml`` | ++----------------+--------------------------------+------------------+ +| Nginx mainline | ``nginx.yml-example-vhost`` | ``nginx.yml`` | ++----------------+--------------------------------+------------------+ + +.. important:: + Do not use ``*.yml-example-rproxy`` templates for global configuration. These are only + intended to be used on a per project base. .. note:: If you simply copy the files to their corresponding template file name, nothing will change @@ -52,7 +56,7 @@ Apache 2.2 ---------- 1. Navigate to ``cfg/vhost-gen/`` inside the Devilbox directory -2. Copy ``apache22.yml-example`` to ``apache22.yml`` and restart the Devilbox +2. Copy ``apache22.yml-example-vhost`` to ``apache22.yml`` and restart the Devilbox 3. Whenever you adjust ``apache22.yml``, you need to restart the Devilbox @@ -60,7 +64,7 @@ Apache 2.4 ---------- 1. Navigate to ``cfg/vhost-gen/`` inside the Devilbox directory -2. Copy ``apache24.yml-example`` to ``apache24.yml`` and restart the Devilbox +2. Copy ``apache24.yml-example-vhost`` to ``apache24.yml`` and restart the Devilbox 3. Whenever you adjust ``apache24.yml``, you need to restart the Devilbox @@ -68,6 +72,5 @@ Nginx stable and Nginx mainline ------------------------------- 1. Navigate to ``cfg/vhost-gen/`` inside the Devilbox directory -2. Copy ``nginx.yml-example`` to ``nginx.yml`` and restart the Devilbox +2. Copy ``nginx.yml-example-vhost`` to ``nginx.yml`` and restart the Devilbox 3. Whenever you adjust ``nginx.yml``, you need to restart the Devilbox - diff --git a/docs/vhost-gen/virtual-host-templates.rst b/docs/vhost-gen/virtual-host-templates.rst index 54b24f99..9b0b937c 100644 --- a/docs/vhost-gen/virtual-host-templates.rst +++ b/docs/vhost-gen/virtual-host-templates.rst @@ -30,7 +30,7 @@ Template files -------------- By default, vhost-gen templates are located within the Devilbox root directory under ``cfg/vhost-gen/``. -The templates file names are suffixed with ``-example`` and are absolutely identical to what is +The templates file names are suffixed with ``-example-`` and are absolutely identical to what is shipped inside each Devilbox web server Docker container. .. code-block:: bash @@ -38,12 +38,15 @@ shipped inside each Devilbox web server Docker container. host> tree -L 1 cfg/vhost-gen/ cfg/vhost-gen/ - ├── apache22.yml-example - ├── apache24.yml-example - ├── nginx.yml-example + ├── apache22.yml-example-rproxy + ├── apache22.yml-example-vhost + ├── apache24.yml-example-rproxy + ├── apache24.yml-example-vhost + ├── nginx.yml-example-rproxy + ├── nginx.yml-example-vhost └── README.md - 0 directories, 4 files + 0 directories, 7 files .. note:: Also note that nginx stable and nginx mainline share the same template as their configuration @@ -69,13 +72,15 @@ All vhost-gen templates consist of three sections: .. |features| replace:: The feature section contains many sub-sections that are replaced into the ``vhost`` |br| section before final rendering. -Templates -========= +Virtual host Templates +====================== + +These templates can be used to alter the behaviour of the vhost on a per project base or globally. Apache 2.2 template ------------------- -.. literalinclude:: ../../cfg/vhost-gen/apache22.yml-example +.. literalinclude:: ../../cfg/vhost-gen/apache22.yml-example-vhost :caption: apache22.yml :language: yaml @@ -83,7 +88,7 @@ Apache 2.2 template Apache 2.4 template ------------------- -.. literalinclude:: ../../cfg/vhost-gen/apache24.yml-example +.. literalinclude:: ../../cfg/vhost-gen/apache24.yml-example-vhost :caption: apache24.yml :language: yaml @@ -91,7 +96,36 @@ Apache 2.4 template Nginx template -------------- -.. literalinclude:: ../../cfg/vhost-gen/nginx.yml-example +.. literalinclude:: ../../cfg/vhost-gen/nginx.yml-example-vhost :caption: nginx.yml :language: yaml + +Reverse proxy Templates +======================= + +These templates can be used to change a normal vhost into a reverse proxy project. This might be +useful if you use NodeJs applications for example. + +Apache 2.2 template +------------------- + +.. literalinclude:: ../../cfg/vhost-gen/apache22.yml-example-rproxy + :caption: apache22.yml + :language: yaml + + +Apache 2.4 template +------------------- + +.. literalinclude:: ../../cfg/vhost-gen/apache24.yml-example-rproxy + :caption: apache24.yml + :language: yaml + + +Nginx template +-------------- + +.. literalinclude:: ../../cfg/vhost-gen/nginx.yml-example-rproxy + :caption: nginx.yml + :language: yaml