fix: handle HEAD requests to /identity for iOS app compatibility
This commit is contained in:
@@ -8,7 +8,7 @@ data:
|
||||
listen 8080;
|
||||
server_name _;
|
||||
|
||||
# Well-known endpoint for Bitwarden clients (multiple variations)
|
||||
# Well-known endpoint for Bitwarden clients
|
||||
location /.well-known/bitwarden/ {
|
||||
default_type application/json;
|
||||
add_header Content-Type application/json always;
|
||||
@@ -23,6 +23,31 @@ data:
|
||||
return 200 '{"object":"bitwarden-bitwarden-host","api":"https://vaultwarden.lotimmy.com"}';
|
||||
}
|
||||
|
||||
location /identity/.well-known/bitwarden/ {
|
||||
default_type application/json;
|
||||
add_header Content-Type application/json always;
|
||||
add_header Access-Control-Allow-Origin * always;
|
||||
return 200 '{"object":"bitwarden-bitwarden-host","api":"https://vaultwarden.lotimmy.com"}';
|
||||
}
|
||||
|
||||
# Identity endpoints - handle HEAD requests directly
|
||||
location ~ ^/identity {
|
||||
# HEAD requests - return 200 OK directly
|
||||
if ($request_method = HEAD) {
|
||||
add_header Content-Length 0;
|
||||
return 200;
|
||||
}
|
||||
# All other requests - proxy to Vaultwarden
|
||||
proxy_pass http://127.0.0.1:80;
|
||||
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 $scheme;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
|
||||
# Forward all other requests to Vaultwarden
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:80;
|
||||
@@ -30,8 +55,6 @@ data:
|
||||
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 $scheme;
|
||||
|
||||
# WebSocket support
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
Reference in New Issue
Block a user