
server {
listen 80;
server_name wiki.domain.de;
root /var/www/html;
index index.html;
}
server {
server_name wiki.domain.de;
root /var/www/html;
index index.html;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/wiki.domain.de/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/wiki.domain.de/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = wiki.domain.de) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name wiki.domain.de;
return 404; # managed by Certbot
server {
server_name wiki.domain.de;
#root /var/www/html;
#index index.html;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/wiki.domain.de/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/wiki.domain.de/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
access_log /var/log/nginx/wiki.domain.de.access.log;
error_log /var/log/nginx/wiki.domain.de.error.log warn;
client_max_body_size 10M;
client_body_buffer_size 128k;
add_header Strict-Transport-Security "max-age=63072000" always;
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive" always;
add_header Content-Security-Policy "upgrade-insecure-requests" always;
# --- OIDC-Callback IMMER durchlassen ---
location = /oidc/authenticator/callback {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port 443;
}
# --- XWiki-Login-Starter durchlassen (sonst Redirect-Loop) ---
location = /bin/login/XWiki/XWikiLogin {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port 443;
}
# --- optionale statische Pfade ohne Session zulassen (schneller) ---
location ~ ^/(resources|skins|webjars|assets)/ {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
}
# --- Haupt-Location: ohne Session => Redirect zum Login-Starter ---
location / {
# Prüft, ob ein JSESSIONID-Cookie gesetzt ist (Groß/Klein egal).
if ($http_cookie !~* "(^|;\\s*)JSESSIONID=") {
return 302 /bin/login/XWiki/XWikiLogin?loginLink=1&xredirect=$request_uri;
}
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 120s;
proxy_send_timeout 120s;
proxy_pass http://127.0.0.1:8080;
}
}
server {
if ($host = wiki.domain.de) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name wiki.domain.de;
return 404; # managed by Certbot
}
# ---------------------------------------------------------------------------
# See the NOTICE file distributed with this work for additional
# information regarding copyright ownership.
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this software; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
# ---------------------------------------------------------------------------
networks:
bridge:
driver: bridge
services:
# The container that runs XWiki in Tomcat, with the appropriate JDBC driver (for postgres).
web:
image: "xwiki:${XWIKI_VERSION}-postgres-tomcat"
container_name: xwiki-postgres-tomcat-web
depends_on:
- db
ports:
- "8080:8080"
# Default values defined in .env file.
# The DB_USER/DB_PASSWORD/DB_DATABASE/DB_HOST variables are used in the hibernate.cfg.xml file.
restart: always
environment:
- XWIKI_VERSION=${XWIKI_VERSION}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_DATABASE=${DB_DATABASE}
- DB_HOST=xwiki-postgres-db
- CATALINA_OPTS=-Xms2048m -Xmx4096m
- TZ=Europe/Berlin
# Provide a name instead of an auto-generated id for xwiki data (the permanent directory in included in it)
# configured in the Dockerfile, to make it simpler to identify in 'docker volume ls'.
volumes:
- /var/apphome/xwiki/xwiki-data:/usr/local/xwiki
networks:
- bridge
# The container that runs the database (postgres)
db:
image: "postgres:18"
container_name: xwiki-postgres-db
restart: always
environment:
- POSTGRES_ROOT_PASSWORD=${POSTGRES_ROOT_PASSWORD}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_USER=${DB_USER}
- POSTGRES_DB=${DB_DATABASE}
- POSTGRES_INITDB_ARGS=--encoding=UTF8 --locale-provider=builtin --locale=C.UTF-8
volumes:
- /var/apphome/xwiki/postgres-data:/var/lib/postgresql
networks:
- bridge
# Default environment values
XWIKI_VERSION=17.10.7
DB_USER=xwiki
DB_PASSWORD=PASSSWORRT11
DB_DATABASE=xwiki
POSTGRES_ROOT_PASSWORD=PASSSWOORRTT22




