Nginx-Config: office.html als Einstiegsseite
Ohne index-Direktive liefert nginx beim Aufruf der Basis-URL ein 403, weil das Directory-Listing deaktiviert ist und es keine index.html gibt. Die Config setzt office.html als Einstiegsseite; try_files sorgt dafuer, dass unbekannte Pfade ein 404 statt eines 403 ergeben. Betrifft auch die Produktion: hinter dem Reverse Proxy (4443 -> 8090) traf ein Aufruf der Basis-URL bisher dasselbe 403. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
10ecad93d5
commit
daef7a2926
2 changed files with 17 additions and 0 deletions
|
|
@ -31,6 +31,8 @@ services:
|
|||
# Ueberlagert den Platzhalter html/API.md - der muss existieren, weil in
|
||||
# einem read-only gemounteten Verzeichnis kein Mountpoint angelegt werden kann.
|
||||
- ./API.md:/usr/share/nginx/html/API.md:ro
|
||||
# Setzt office.html als Einstiegsseite (sonst 403 auf der Basis-URL).
|
||||
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
ports:
|
||||
- "8090:80"
|
||||
|
||||
|
|
|
|||
15
docker/nginx/default.conf
Normal file
15
docker/nginx/default.conf
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# Einstiegsseite ist die Buero-Visualisierung - ohne diese Direktive liefert
|
||||
# nginx beim Aufruf der Basis-URL ein 403 (Directory-Listing ist deaktiviert,
|
||||
# und eine index.html gibt es nicht).
|
||||
index office.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue