@@ -16,12 +16,12 @@ Requirements
1616* Apache installation with the following modules activated:
1717 * mod_rewrite
1818 * libapache2-mod-php
19+ * alternatively: nginx installation with the following modules activated:
20+ * php-fpm
1921* PostgreSQL Installation
2022 * It is recommended to use a PostgreSQL database for Mapbender.
2123 * It is recommended to create a database user to access the Mapbender database.
2224
23- Nginx can also be used as web server (this will not be discussed in detail here).
24-
2525
2626Preparation
2727-----------
@@ -72,6 +72,51 @@ Activate the site and reload Apache:
7272 a2ensite mapbender.conf
7373 service apache2 reload
7474
75+ Configuration nginx
76+ -------------------
77+
78+ As an alternative to apache2, nginx can also be used as webserver.
79+ To use Mapbender in nginx, create a configuration file within ``/etc/nginx/sites-available ``:
80+
81+ .. code-block :: nginx
82+
83+ server {
84+ listen 80;
85+ listen [::]:80;
86+ server_name mapbender.localhost # change this to your needs
87+
88+ # recommended to setup ssl here when not in a local environment
89+
90+ root /var/www/mapbender/application/public;
91+
92+ index index.php;
93+
94+ location / {
95+ # First attempt to serve request as file, then
96+ # as directory, then redirect to index.php
97+ try_files $uri $uri/ /index.php$is_args$args;
98+ }
99+
100+ # pass PHP scripts to FastCGI server
101+ location ~ \.php$ {
102+ include snippets/fastcgi-php.conf;
103+ fastcgi_pass unix:/run/php/php8.3-fpm.sock; # change this when using another PHP version
104+ }
105+
106+ # deny access to .htaccess files, if Apache's document root
107+ # concurs with nginx's one
108+ location ~ /\.ht {
109+ deny all;
110+ }
111+ }
112+
113+ Activate the new site and restart nginx:
114+
115+ .. code-block :: bash
116+
117+ ln -s /etc/nginx/sites-available/mapbender /etc/nginx/sites-enabled/
118+ systemctl restart nginx
119+
75120
76121 Directory rights
77122----------------
0 commit comments