initial commit
This commit is contained in:
52
nginx-conf/default.conf
Normal file
52
nginx-conf/default.conf
Normal file
@ -0,0 +1,52 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name rubble.se localhost;
|
||||
|
||||
# (valfritt) statiskt default
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# OBS: låt / flöda sist, annars kan try_files vinna över prefixen
|
||||
|
||||
# ---- Flappy (som tidigare) ----
|
||||
location ^~ /flappy/ {
|
||||
proxy_pass http://flappy/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
rewrite ^/flappy(/.*)$ $1 break;
|
||||
}
|
||||
location = /flappy { return 301 /flappy/; }
|
||||
|
||||
# ---- HemHub API under /hemhub ----
|
||||
location ^~ /hemhub/ {
|
||||
# Viktigt: denna fångar även /hemhub/auth/, så vi behöver en mer specifik block nedan
|
||||
proxy_pass http://hemhub-api:8080/; # trailing slash => strippar /hemhub/
|
||||
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-Proto https;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
# ---- Keycloak under /hemhub/auth ----
|
||||
# Mer specifik => placera DENNA FÖRE /hemhub/ eller använd ^~ (gör vi här)
|
||||
location ^~ /hemhub/auth/ {
|
||||
proxy_pass http://kc-main:8080/; # trailing slash => strippar /hemhub/auth/
|
||||
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-Proto https;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
# ---- Health ----
|
||||
location = /health {
|
||||
return 200 "ok\n";
|
||||
add_header Content-Type text/plain;
|
||||
}
|
||||
|
||||
# ---- Default root sist (så att prefix-blocken alltid vinner) ----
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user