Reopened: Domain URL configuration results in 404 #1694 #1062

Closed
opened 2026-02-04 23:46:21 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @kingofthering on GitHub (Jun 29, 2021).

My problem #1694 is unfortunately not solved yet.

To make my setup easier, I have now installed docker locally on my Apache proxy.
I can start the docker container and have set all parameters as env variable.

I can set the domain via config and everything works. If I restart the conterer I get the same behavior as before in #1694 on restart of the container ... ressource not found.
When I set DOMAIN as env I get the same problem.

Your environment (Generated via diagnostics page)

  • Vaultwarden version: v1.22.1
  • Web-vault version: v2.20.4b
  • Running within Docker: true
  • Environment settings overridden: true
  • Uses a reverse proxy: true
  • IP Header check: true (X-Real-IP)
  • Internet access: true
  • Internet access via a proxy: false
  • DNS Check: true
  • Time Check: true
  • Domain Configuration Check: true
  • HTTPS Check: true
  • Database type: SQLite
  • Database version: 3.35.4
  • Clients used:
  • Reverse proxy and version:
  • Other relevant information:

Config (Generated via diagnostics page)

Show Running Config

Environment settings which are overridden: ORG_CREATION_USERS, ADMIN_TOKEN, SMTP_HOST, SMTP_FROM, SMTP_FROM_NAME, SMTP_USERNAME, SMTP_PASSWORD

{
  "_duo_akey": null,
  "_enable_duo": false,
  "_enable_email_2fa": true,
  "_enable_smtp": true,
  "_enable_yubico": true,
  "_ip_header_enabled": true,
  "admin_token": "***",
  "allowed_iframe_ancestors": "",
  "attachments_folder": "data/attachments",
  "authenticator_disable_time_drift": false,
  "data_folder": "data",
  "database_max_conns": 10,
  "database_url": "****/**.*******",
  "db_connection_retries": 15,
  "disable_2fa_remember": false,
  "disable_admin_token": false,
  "disable_icon_download": false,
  "domain": "*****://*******.**/*********/",
  "domain_origin": "*****://*******.**",
  "domain_path": "/*********",
  "domain_set": true,
  "duo_host": null,
  "duo_ikey": null,
  "duo_skey": null,
  "email_attempts_limit": 3,
  "email_expiration_time": 600,
  "email_token_size": 6,
  "enable_db_wal": true,
  "extended_logging": true,
  "helo_name": null,
  "hibp_api_key": null,
  "icon_blacklist_non_global_ips": true,
  "icon_blacklist_regex": null,
  "icon_cache_folder": "data/icon_cache",
  "icon_cache_negttl": 259200,
  "icon_cache_ttl": 2592000,
  "icon_download_timeout": 10,
  "invitation_org_name": "Vaultwarden",
  "invitations_allowed": true,
  "ip_header": "X-Real-IP",
  "job_poll_interval_ms": 30000,
  "log_file": null,
  "log_level": "Info",
  "log_timestamp_format": "%Y-%m-%d %H:%M:%S.%3f",
  "org_attachment_limit": null,
  "org_creation_users": "****@*******.**",
  "password_iterations": 100000,
  "reload_templates": false,
  "require_device_email": false,
  "rsa_key_filename": "data/rsa_key",
  "send_purge_schedule": "0 5 * * * *",
  "sends_allowed": true,
  "sends_folder": "data/sends",
  "show_password_hint": true,
  "signups_allowed": true,
  "signups_domains_whitelist": "",
  "signups_verify": false,
  "signups_verify_resend_limit": 6,
  "signups_verify_resend_time": 3600,
  "smtp_accept_invalid_certs": false,
  "smtp_accept_invalid_hostnames": false,
  "smtp_auth_mechanism": null,
  "smtp_debug": false,
  "smtp_explicit_tls": false,
  "smtp_from": "****@*********.***",
  "smtp_from_name": "Bitwarden",
  "smtp_host": "****.****.***",
  "smtp_password": "***",
  "smtp_port": 587,
  "smtp_ssl": true,
  "smtp_timeout": 15,
  "smtp_username": "****@*******.**",
  "templates_folder": "data/templates",
  "trash_auto_delete_days": null,
  "trash_purge_schedule": "0 5 0 * * *",
  "use_syslog": false,
  "user_attachment_limit": null,
  "web_vault_enabled": true,
  "web_vault_folder": "web-vault/",
  "websocket_address": "0.0.0.0",
  "websocket_enabled": false,
  "websocket_port": 3012,
  "yubico_client_id": null,
  "yubico_secret_key": null,
  "yubico_server": null
}
Originally created by @kingofthering on GitHub (Jun 29, 2021). My problem #1694 is unfortunately not solved yet. To make my setup easier, I have now installed docker locally on my Apache proxy. I can start the docker container and have set all parameters as env variable. I can set the domain via config and everything works. If I restart the conterer I get the same behavior as before in #1694 on restart of the container ... ressource not found. When I set DOMAIN as env I get the same problem. ### Your environment (Generated via diagnostics page) * Vaultwarden version: v1.22.1 * Web-vault version: v2.20.4b * Running within Docker: true * Environment settings overridden: true * Uses a reverse proxy: true * IP Header check: true (X-Real-IP) * Internet access: true * Internet access via a proxy: false * DNS Check: true * Time Check: true * Domain Configuration Check: true * HTTPS Check: true * Database type: SQLite * Database version: 3.35.4 * Clients used: * Reverse proxy and version: * Other relevant information: ### Config (Generated via diagnostics page) <details><summary>Show Running Config</summary> **Environment settings which are overridden:** ORG_CREATION_USERS, ADMIN_TOKEN, SMTP_HOST, SMTP_FROM, SMTP_FROM_NAME, SMTP_USERNAME, SMTP_PASSWORD ```json { "_duo_akey": null, "_enable_duo": false, "_enable_email_2fa": true, "_enable_smtp": true, "_enable_yubico": true, "_ip_header_enabled": true, "admin_token": "***", "allowed_iframe_ancestors": "", "attachments_folder": "data/attachments", "authenticator_disable_time_drift": false, "data_folder": "data", "database_max_conns": 10, "database_url": "****/**.*******", "db_connection_retries": 15, "disable_2fa_remember": false, "disable_admin_token": false, "disable_icon_download": false, "domain": "*****://*******.**/*********/", "domain_origin": "*****://*******.**", "domain_path": "/*********", "domain_set": true, "duo_host": null, "duo_ikey": null, "duo_skey": null, "email_attempts_limit": 3, "email_expiration_time": 600, "email_token_size": 6, "enable_db_wal": true, "extended_logging": true, "helo_name": null, "hibp_api_key": null, "icon_blacklist_non_global_ips": true, "icon_blacklist_regex": null, "icon_cache_folder": "data/icon_cache", "icon_cache_negttl": 259200, "icon_cache_ttl": 2592000, "icon_download_timeout": 10, "invitation_org_name": "Vaultwarden", "invitations_allowed": true, "ip_header": "X-Real-IP", "job_poll_interval_ms": 30000, "log_file": null, "log_level": "Info", "log_timestamp_format": "%Y-%m-%d %H:%M:%S.%3f", "org_attachment_limit": null, "org_creation_users": "****@*******.**", "password_iterations": 100000, "reload_templates": false, "require_device_email": false, "rsa_key_filename": "data/rsa_key", "send_purge_schedule": "0 5 * * * *", "sends_allowed": true, "sends_folder": "data/sends", "show_password_hint": true, "signups_allowed": true, "signups_domains_whitelist": "", "signups_verify": false, "signups_verify_resend_limit": 6, "signups_verify_resend_time": 3600, "smtp_accept_invalid_certs": false, "smtp_accept_invalid_hostnames": false, "smtp_auth_mechanism": null, "smtp_debug": false, "smtp_explicit_tls": false, "smtp_from": "****@*********.***", "smtp_from_name": "Bitwarden", "smtp_host": "****.****.***", "smtp_password": "***", "smtp_port": 587, "smtp_ssl": true, "smtp_timeout": 15, "smtp_username": "****@*******.**", "templates_folder": "data/templates", "trash_auto_delete_days": null, "trash_purge_schedule": "0 5 0 * * *", "use_syslog": false, "user_attachment_limit": null, "web_vault_enabled": true, "web_vault_folder": "web-vault/", "websocket_address": "0.0.0.0", "websocket_enabled": false, "websocket_port": 3012, "yubico_client_id": null, "yubico_secret_key": null, "yubico_server": null } ``` </details>
OVERLORD added the troubleshooting label 2026-02-04 23:46:21 +03:00
Author
Owner

@BlackDex commented on GitHub (Jun 29, 2021):

We need at least some logs stating the 404 from the vaultwarden logs and the Apache logs.

Also, the config.json is precedent and overrulles all env variables, so if you config something in there, and then restart, it should work, if not, then the config.json is faulty.

You also state that if you modify the domain in the config.json it works, so that kinda looks to me like something is wrong with an env variable which causes an issue further on.

Please rename the config.json to something like config.json.disabled configure everything via the -e or docker-compose.yml file, what ever you use.
Could you also try to remove the trailing / from the DOMAIN variable and see what happens.

But we really need more detailed information, logs etc..
Also, enable LOG_LEVEL=debug so that you will get more detailed information to see if there is something wrong there.

@BlackDex commented on GitHub (Jun 29, 2021): We need at least some logs stating the 404 from the vaultwarden logs and the Apache logs. Also, the config.json is precedent and overrulles all env variables, so if you config something in there, and then restart, it should work, if not, then the config.json is faulty. You also state that if you modify the domain in the config.json it works, so that kinda looks to me like something is wrong with an env variable which causes an issue further on. Please rename the `config.json` to something like `config.json.disabled` configure everything via the `-e` or `docker-compose.yml` file, what ever you use. Could you also try to remove the trailing `/` from the `DOMAIN` variable and see what happens. But we really need more detailed information, logs etc.. Also, enable `LOG_LEVEL=debug` so that you will get more detailed information to see if there is something wrong there.
Author
Owner

@BlackDex commented on GitHub (Jun 30, 2021):

Also, i see you are using a sub-folder, so make sure you are using the correct config:
Apache in a sub-location (by ss89) @ https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples

@BlackDex commented on GitHub (Jun 30, 2021): Also, i see you are using a sub-folder, so make sure you are using the correct config: `Apache in a sub-location (by ss89)` @ https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples
Author
Owner

@kingofthering commented on GitHub (Jul 2, 2021):

Hi,
the proxy subfolder configuration looks good, also proxy_wstunnel_module is loaded:

SSLProxyEngine on
<Location /bitwarden/>
ProxyPreserveHost On
RequestHeader set X-Real-IP %{REMOTE_ADDR}s
ProxyPass http://localhost:5555/
ProxyPassReverse http://localhost:5555/

Dockered Vaultwarden is running on the apache localhost port 5555.

I have deleted the config.json file and restarted with:

Thx for your support!!!
Env
11 EXTENDED_LOGGING=true
12 LOG_LEVEL=debug
13 DOMAIN=https://tld.com/bitwarden/

I have tried it without trailing slash and nothing changes...

Vaultwarden log:

[/--------------------------------------------------------------------,
| Starting Vaultwarden |,
| Version 1.22.1 |,
|--------------------------------------------------------------------|,
| This is an unofficial Bitwarden implementation, DO NOT use the |,
| official channels to report bugs/features, regardless of client. |,
| Send usage/configuration questions or feature requests to: |,
| https://vaultwarden.discourse.group/ |,
| Report suspected bugs/issues in the software itself at: |,
| https://github.com/dani-garcia/vaultwarden/issues/new |,
--------------------------------------------------------------------/,
,
FO] No .env file found.,
,
[2021-07-01 21:18:48.425][routes][INFO] Routes loaded:,
[2021-07-01 21:18:48.460][routes][INFO] GET /bitwarden,
[2021-07-01 21:18:48.460][routes][INFO] GET /bitwarden/<p..> [10],
[2021-07-01 21:18:48.460][routes][INFO] GET /bitwarden/admin [1],
[2021-07-01 21:18:48.460][routes][INFO] GET /bitwarden/admin [2],
[2021-07-01 21:18:48.460][routes][INFO] POST /bitwarden/admin,
....
[2021-07-01 21:18:48.462][routes][INFO] POST /bitwarden/identity/connect/token,
[2021-07-01 21:18:48.462][routes][INFO] GET /bitwarden/notifications/hub,
[2021-07-01 21:18:48.462][routes][INFO] POST /bitwarden/notifications/hub/negotiate,
[2021-07-01 21:18:48.462][start][INFO] Rocket has launched from http://0.0.0.0:80,
[2021-07-01 21:18:49.179][request][INFO] GET /admin,
[2021-07-01 21:18:49.179][response][INFO] 404 Not Found,
[2021-07-01 21:19:02.051][request][INFO] GET /notifications/hub?access_token=xyz,
[2021-07-01 21:19:02.051][response][INFO] 404 Not Found,
[2021-07-01 21:19:47.987][request][INFO] GET /bitwarden/alive,
[2021-07-01 21:19:47.987][response][INFO] GET /bitwarden/alive (alive) => 200 OK,
[2021-07-01 21:20:23.091][request][INFO] GET /notifications/hub?access_token=xyz,
[2021-07-01 21:20:23.092][response][INFO] 404 Not Found,
[2021-07-01 21:20:48.130][request][INFO] GET /bitwarden/alive,
[2021-07-01 21:20:48.131][response][INFO] GET /bitwarden/alive (alive) => 200 OK,

Apache proxy logs:
xyz - - [01/Jul/2021:23:23:59 +0200] "GET /favicon.ico HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" CTRY: DE
xyz - - [01/Jul/2021:23:24:12 +0200] "GET /bitwarden/admin HTTP/1.1" 404 597 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" CTRY: DE

@kingofthering commented on GitHub (Jul 2, 2021): Hi, the proxy subfolder configuration looks good, also proxy_wstunnel_module is loaded: SSLProxyEngine on <Location /bitwarden/> ProxyPreserveHost On RequestHeader set X-Real-IP %{REMOTE_ADDR}s ProxyPass http://localhost:5555/ ProxyPassReverse http://localhost:5555/ </Location> Dockered Vaultwarden is running on the apache localhost port 5555. I have deleted the config.json file and restarted with: Thx for your support!!! Env 11 EXTENDED_LOGGING=true 12 LOG_LEVEL=debug 13 DOMAIN=https://tld.com/bitwarden/ I have tried it without trailing slash and nothing changes... Vaultwarden log: [/--------------------------------------------------------------------\, | Starting Vaultwarden |, | Version 1.22.1 |, |--------------------------------------------------------------------|, | This is an *unofficial* Bitwarden implementation, DO NOT use the |, | official channels to report bugs/features, regardless of client. |, | Send usage/configuration questions or feature requests to: |, | https://vaultwarden.discourse.group/ |, | Report suspected bugs/issues in the software itself at: |, | https://github.com/dani-garcia/vaultwarden/issues/new |, \--------------------------------------------------------------------/, , FO] No .env file found., , [2021-07-01 21:18:48.425][routes][INFO] Routes loaded:, [2021-07-01 21:18:48.460][routes][INFO] GET /bitwarden, [2021-07-01 21:18:48.460][routes][INFO] GET /bitwarden/<p..> [10], [2021-07-01 21:18:48.460][routes][INFO] GET /bitwarden/admin [1], [2021-07-01 21:18:48.460][routes][INFO] GET /bitwarden/admin [2], [2021-07-01 21:18:48.460][routes][INFO] POST /bitwarden/admin, .... [2021-07-01 21:18:48.462][routes][INFO] POST /bitwarden/identity/connect/token, [2021-07-01 21:18:48.462][routes][INFO] GET /bitwarden/notifications/hub, [2021-07-01 21:18:48.462][routes][INFO] POST /bitwarden/notifications/hub/negotiate, [2021-07-01 21:18:48.462][start][INFO] Rocket has launched from http://0.0.0.0:80, [2021-07-01 21:18:49.179][request][INFO] GET /admin, [2021-07-01 21:18:49.179][response][INFO] 404 Not Found, [2021-07-01 21:19:02.051][request][INFO] GET /notifications/hub?access_token=xyz, [2021-07-01 21:19:02.051][response][INFO] 404 Not Found, [2021-07-01 21:19:47.987][request][INFO] GET /bitwarden/alive, [2021-07-01 21:19:47.987][response][INFO] GET /bitwarden/alive (alive) => 200 OK, [2021-07-01 21:20:23.091][request][INFO] GET /notifications/hub?access_token=xyz, [2021-07-01 21:20:23.092][response][INFO] 404 Not Found, [2021-07-01 21:20:48.130][request][INFO] GET /bitwarden/alive, [2021-07-01 21:20:48.131][response][INFO] GET /bitwarden/alive (alive) => 200 OK, Apache proxy logs: xyz - - [01/Jul/2021:23:23:59 +0200] "GET /favicon.ico HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" CTRY: DE xyz - - [01/Jul/2021:23:24:12 +0200] "GET /bitwarden/admin HTTP/1.1" 404 597 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0" CTRY: DE
Author
Owner

@BlackDex commented on GitHub (Jul 2, 2021):

Your apache config doesn't match on the important parts with the one i mentioned. I'm missing the rewrite rule for one, which is only used for websockets but still.

And the most important one, I'm missing the sublocation in your proxypass config.

@BlackDex commented on GitHub (Jul 2, 2021): Your apache config doesn't match on the important parts with the one i mentioned. I'm missing the rewrite rule for one, which is only used for websockets but still. And the most important one, I'm missing the sublocation in your proxypass config.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1062