Fix vhost-gen documentation to also reflect changes of rproxy templates

This commit is contained in:
cytopia 2018-12-29 17:38:15 +01:00
parent 03ead39f2c
commit c93f97ce2e
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
3 changed files with 63 additions and 26 deletions

View File

@ -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:

View File

@ -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

View File

@ -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-<type>`` 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