Skip to content

Commit

Permalink
Update doc for Nginx (#163)
Browse files Browse the repository at this point in the history
* Update doc for Nginx

* Remove dependencies

* Update docs/installation.rst

Co-authored-by: Clément "KPTN" OUDOT <[email protected]>

* Update docs/configuration-nginx.rst

Co-authored-by: Clément "KPTN" OUDOT <[email protected]>

* Update docs/installation.rst

Co-authored-by: Clément "KPTN" OUDOT <[email protected]>

* Update docs/configuration-nginx.rst

Co-authored-by: Clément "KPTN" OUDOT <[email protected]>

---------

Co-authored-by: Clément "KPTN" OUDOT <[email protected]>
  • Loading branch information
Christophe Maudoux and coudot authored Aug 21, 2024
1 parent 6fbbacb commit 342ee73
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 15 deletions.
25 changes: 14 additions & 11 deletions docs/audit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,36 @@ Set the file where actions are logged:
.. tip:: The file must be writable by the PHP or WebServer process


Admin name
----------

The admin name must be set into an HTTP header.

Using Apache, we could use instead:

.. code-block:: php
$header_name_audit_admin = "Auth-User";
$header_name_audit_admin = "Auth-User";
Using Nginx, we could use instead:

.. code-block:: php
$header_name_audit_admin = "AUTH_USER";
$header_name_audit_admin = "AUTH_USER";
In nginx.conf:

.. code-block:: nginx
server {
[...]
location ~ \.php {
fastcgi_param HTTP_AUTH_USER $http_auth_user;
[...]
}
[...]
}
server {
[...]
location ~ \.php$ {
fastcgi_param HTTP_AUTH_USER $http_auth_user;
[...]
}
[...]
}
.. warning:: Using Nginx, headers with underscores in their names are discarded by default. In order for these headers to be considered valid, we need to add ``underscores_in_headers on`` to ``nginx.conf``.

Expand Down
File renamed without changes.
60 changes: 60 additions & 0 deletions docs/configuration-nginx.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.. _nginx_configuration:

Nginx configuration
====================

Apache or Nginx is not installed by default. You must choose one.

Current section explains how to install and configure Nginx.

Install and configure Nginx
----------------------------

On Debian:

.. code-block:: shell
apt install nginx php-fpm
# configure php-fpm for Nginx
a2enmod proxy_fcgi setenvif
a2enconf php*-fpm.conf
# enable the default website
cd /etc/nginx/sites-enabled/ && ln -s ../sites-availables/service-desk
On RHEL systems:

.. code-block:: shell
dnf install nginx php-fpm
Virtual host configuration
------------

Here is a sample block server configuration:

.. code-block:: nginx
server {
listen 80;
server_name sd.example.com;
root /usr/share/service-desk/htdocs;
index index.php;
location ~ \.php$ {
try_files $uri $uri/ =404;
fastcgi_pass unix:/run/php/php-fpm.sock;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
}
.. warning:: You must protect the access to the application, else everyone will be able to reset any user password!

External authentication
-----------------------

You can use any authentication source and authentication protocols supported by Nginx.
Configuring these solutions is out of scope of the current documentation.
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ LDAP Tool Box Service Desk documentation
installation.rst
upgrade.rst
configuration-apache.rst
configuration-nginx.rst
general-parameters.rst
ldap-parameters.rst
attributes.rst
Expand All @@ -26,5 +27,5 @@ LDAP Tool Box Service Desk documentation
lockaccount.rst
hook.rst
dashboards.rst
config_mail.rst
configuration-mail.rst
audit.rst
7 changes: 4 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Configure the repository:

.. code-block:: ini
deb [arch=amd64 signed-by=/usr/share/keyrings/ltb-project-openldap-archive-keyring.gpg] https://ltb-project.org/debian/stable stable main
Then update:
Expand All @@ -56,7 +55,8 @@ You are now ready to install:

apt install service-desk

You should now proceed to :ref:`webserver installation and configuration <apache_configuration>`
You should now proceed to :ref:`Apache installation and configuration <apache_configuration>`
or to :ref:`Nginx installation and configuration <nginx_configuration>`

CentOS / RedHat
---------------
Expand Down Expand Up @@ -97,7 +97,8 @@ You are now ready to install:

dnf install service-desk

You should now proceed to :ref:`webserver installation and configuration <apache_configuration>`
You should now proceed to :ref:`Apache installation and configuration <apache_configuration>`
or to :ref:`Nginx installation and configuration <nginx_configuration>`

Docker
------
Expand Down

0 comments on commit 342ee73

Please sign in to comment.