.. hint:: Always allow access from `91.199.98.23` and `2a04:503:0:102::2:4` (monitoring)
or add custom MIME types:
::
include mime.types;
types {
text/cache-manifest appcache;
}
if you like to run PHP in this subdirectory, don't forget to add this
nested in the location section from the example on top:
::
location ~ \.php {
try_files /dummy/$uri @php;
}
.. hint:: for Details, see the `Server Block Examples <http://wiki.nginx.org/ServerBlockExample>`__ and `Rewrite Rule <http://wiki.nginx.org/HttpRewriteModule#rewrite>`__ documentation
~/cnf/nginx-prod.conf
^^^^^^^^^^^^^^^^^^^^^
Included within the server block on each website with environment set to PROD. For configuration examples, see the description of `~/cnf/nginx.conf`_ above.
~/cnf/nginx-stage.conf
^^^^^^^^^^^^^^^^^^^^^^
Included within the server block on each website with environment set to STAGE. For configuration examples, see the description of `~/cnf/nginx.conf`_ above.
~/cnf/nginx-dev.conf
^^^^^^^^^^^^^^^^^^^^
Included within the server block on each website with environment set to DEV. For configuration examples, see the description of `~/cnf/nginx.conf`_ above.
~/cnf/nginx\_waf.conf
^^^^^^^^^^^^^^^^^^^^^
Configure WAF exeptions here, see `Web Application Firewall`_ for details.
/etc/nginx/custom/http.conf
^^^^^^^^^^^^^^^^^^^^^^^^^^^
This file is directly integrated in ``http { }``, before ``server { }`` and can only be edited with the ``devop`` user. You can use this file for settings that must be configured at nginx http context.
custom configuration include
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Include your own, external configuration files within ``server { }`` or ``http { }`` by including the following configuration to your server's ``Custom JSON``:
* server level: set ``nginx::global_config::server_file``
* http level: set ``nginx::global_config::http_file``
.. warning:: if the configured files can not be found, the webserver will not be able to start.
.. hint:: with this setting, you can deploy own, system wide configuration files from a Git repository. See :ref:`globalrepo` for details.
custom webroot
^^^^^^^^^^^^^^
By default, the webroot directory location is choosen according vendor recommendations,
depending on the selected type.
Some deployment workflows require other locations, which you can select through the
`custom_webroot` parameter, relative to the home directory.
.. warning:: by now, the directory specified here needs to be a real directory (**no symlinks allowed**)
.. code-block:: json
{
"custom_webroot": "deploy/current/html"
}
custom log format
^^^^^^^^^^^^^^^^^
To alter the format used for nginx access logs, for example due to privacy reasons, you can use the ``website::wrapper::nginx::log_format`` configuration.
This configuration is only available globally for all websites on a server, to change to default "combined" format to replace the actual visitors ip address with 127.0.0.1, use the following example:
You have to define one of the following types for each website.
The selected `type` will determine the configuration of your website.
Basic Types
===========
To run your own application with a certain technology stack, use one
of our basic types.
.. index::
triple: Website; Type; Docker
:name: website-type_docker
Docker
------
This Type is used to run your own Docker container behind a website acting
as reverse proxy.
* a website type :ref:`website-type_proxy` is configured
* Docker will be installed and configured
* created website user is member of the `docker` group and thus allowed
to execute ``docker`` commands
.. tip:: Also take a look at our How-to :ref:`howto-docker`.
.. index::
triple: Website; Type; HTML
:name: website-type_html
HTML
----
Used to create a HTML only website with no dynamic processing altogether.
.. index::
triple: Website; Type; Node.js
:name: website-type_nodejs
Node.js
-------
* your Node.js application is run with a daemon on controlled by Monit
* select custom node version trough `nvm <https://github.com/creationix/nvm#usage>`__, by default, the latest node lts version is installed
* nodejs has to listen on the ``~/cnf/nodejs.sock`` socket, permission ``660``
* symlink your app.js to ``~/app.js`` or overwrite path or other daemon
options in ``OPTIONS`` at ``~/cnf/nodejs-daemon``:
::
OPTIONS="/home/nodejs/application/app.js --prod"
.. tip:: to control the nodejs daemon, use the ``nodejs-restart`` shortcut
.. index::
triple: Website; Type; PHP
:name: website-type_php
PHP
---
* PHP installed and running as FPM service included in nginx
* you can select the desired version at the `Advanced` tab
* for custom configurations, see :ref:`website-advanced-php`
Python
------
* uWSGI Daemon (Symlink your appropriate wsgi configuration to ``~/wsgi.py``)
* Python virtualenv ``venv-<sitename>`` configured within uWSGI and the user login shell
.. hint:: To control the uwsgi daemon, use the ``uwsgi-reload`` and ``uwsgi-restart`` shortcuts.
.. index::
triple: Website; Type; Proxy
:name: website-type_proxy
Proxy
-----
* nginx website configured as reverse proxy
* select the desired backend with the `Proxy Pass` setting
.. tip::
To use advanced features like multiple backends, create your own upstream configuration in ``/etc/nginx/custom/http.conf`` and point ``proxy_pass`` to it.
See :ref:`website-advanced-nginx_server` nginx configuration.
.. index::
triple: Website; Type; Redirect
:name: website-type_redirect
Redirect
--------
* to redirects everything to a custom target
* set `Target` to your desired destination
* by default, we send a 307 HTTP redirect code
To use your own redirect code, add the ``target_code`` string within the
`Custom JSON` :ref:`customjson_website`:
.. code-block:: json
{
"target_code": "301"
}
.. hint:: You can use any nginx variable as target (for example ``$scheme://www.example.com$request_uri``), see the `nginx Documentation <http://nginx.org/en/docs/varindex.html>`__ for available variables.
.. index::
triple: Website; Type; Ruby
:name: website-type_ruby
Ruby
----
* ruby rbenv configured within foreman and the user login shell
* foreman daemon, controlled by Monit
* ruby has to listen on the ``~/cnf/ruby.sock`` socket, permission ``660``
* symlink your Procfile to ``~/`` or overwrite path or other daemon
options in ``OPTIONS`` at ``~/cnf/ruby-daemon``:
::
OPTIONS="start web -f project/Procfile"
.. tip:: To control the ruby daemon, use the ``ruby-start`` / ``ruby-stop`` / ``ruby-restart`` shortcuts.
Application Types
=================
We provide elaborated types for certain web applications. If your desired
application is amongst them, we recommend to use them instead of a basic
type.
.. index::
triple: Website; Type; Magento 1
:name: website-type_magento1
Magento 1
---------
.. index::
triple: Website; Type; Magento 2
:name: website-type_magento2
Magento 2
---------
.. index::
triple: Website; Type; Neos
:name: website-type_neos
Neos
----
.. index::
triple: Website; Type; TYPO3 6
:name: website-type_typo3v6
TYPO3 v6
--------
.. index::
triple: Website; Type; TYPO3 7
:name: website-type_typo3v7
TYPO3 v7
--------
.. index::
triple: Website; Type; TYPO3 8
:name: website-type_typo3v8
TYPO3 v8
--------
.. index::
triple: Website; Type; TYPO3 9
:name: website-type_typo3v9
TYPO3 v9
--------
.. index::
triple: Website; Type; TYPO3 10
:name: website-type_typo3v10
TYPO3 v10
---------
.. index::
triple: Website; Type; Wordpress
:name: website-type_wordpress
Wordpress
---------
.. note:: If you need a type not mentioned here yet, do not hesitate to contact us
typo3cmsv10 (Alpha)
^^^^^^^^^^^^^^^^^^^
...
...
@@ -108,7 +306,7 @@ neos
- ~/web
- PHP and nginx settings adjusted to Neos requirements
- ``FLOW_CONTEXT`` set according the selected context (see :ref:`website_context`)
- ``FLOW_CONTEXT`` set according the selected context (see :ref:`website-context`)
- ``FLOW_REWRITEURLS`` enabled
required configuration
...
...
@@ -179,42 +377,6 @@ wordpress
.. hint:: Please disable the built in HTTP call to wp-cron.php by setting ``define('DISABLE_WP_CRON', true);``. This additional call is not necessary and disabling it will lower the load on your system.