Repository navigation
Clarify how to use APP_BASE and APP_FULL_BASE_URL #174
Description
Activity
@johanneskastl I see you have figured this out from the other thread, but if you have not yet found the examples provided in config file of the passbolt_api repo they are here: https://github.com/passbolt/passbolt_api/blob/master/config/passbolt.default.php
@garrettboone Thanks for the link. This at least clarifies that the
APP_BASEmust not contain a trailing slash.But it still does not answer, if
APP_FULL_BASE_URLshould contain the subdirectory?I prepared a PR to improve the documentation, I would be glad if you could have a look at #176
see #175 (comment)
"APP_BASE" is a folder on the server. Variables with "URL" in the name are related to the URL. I think you are confusing the term "directory" with url "path".
"APP_BASE" is a folder on the server. Variables with "URL" in the name are related to the URL. I think you are confusing the term "directory" with url "path".
Hi @garrettboone I might be confusing things, yes. That is why I would like to improve the documentation on that. :-)
It boils down to this:
I want passbolt to be reachable viaexample.com/passbolt. What is needed to do that?@johanneskastl Just to confirm, the
passboltpath is only in the url and does not reflect a folder on your server you have created namedpassbolt, correct?See https://community.passbolt.com/t/passbolt-install-in-a-subfolder/2885/5
Though they still used a folder, NGINX can handle the rewriting of the path.
@johanneskastl do you need the /passbolt/ path to continue to show? Or, is it enough for you if that path gets re-written so it does not show.?
For example if you add this to your NGINX config it will cause the url to be rewritten from
example.com/passbolt/paramsto justexample.com/params:location /passbolt { rewrite ^/passbolt(.*)$ https://example.com$1 break; }This assumes that users can access the host url on it's own (example.com). So, if you need the
/passboltto always show, but you do NOT want to install the app in a different location then you need to do the following:- add another server section to your NGINX with a separate port and configure NGINX to be a reverse proxy to this other port. Like this:
upstream passbolt { server 127.0.0.1:4444; } server { listen 80; server_name example.com; return 301 https://example.com; } server { listen 443 ssl http2; server_name example.com # ssl stuff location /passbolt/ { proxy_pass https://passbolt/; proxy_set_header Host $host; } } server { listen 4444 ssl http2; server_name 127.0.0.1; root /usr/share/php/passbolt/webroot; index index.php; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass unix:/run/php/php7.4-fpm.sock; fastcgi_index index.php; fastcgi_intercept_errors on; fastcgi_split_path_info ^(.+\.php)(.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SERVER_NAME $http_host; fastcgi_param PHP_VALUE "upload_max_filesize=5M post_max_size=5M"; } }- To passbolt.php add
'base' => '/passbolt',
This fools the app into thinking it's installed in a
passboltfolder but it's not. I've left out some NGINX ssl options and other things...but hopefully this helps.do you need the /passbolt/ path to continue to show? Or, is it enough for you if that path gets re-written so it does not show.?
Hi @garrettboone Thanks for the long and detailed answer.
I would need the
/passboltto show in the URL, to not confuse users, as/is serving other content unrelated to Passbolt.As I am using the docker container, I cannot modify the application (or move it) inside the docker container, except via environment variables. Hence I thought I could solve this using
APP_BASE.As this is being served behind a Traefik as reverse proxy, I am currently trying to get it to do the magic. I'll try to translate your nginx example, but this might fail, as I cannot move the webroot to
/usr/share/php/passbolt/webroot(docker container...).The forum can help. There are many ways to handle it.
Hi!
Would it be enough to publish a better readme section regarding these env variables APP_BASE and APP_FULL_BASE_URL?
Reacted by Adrien Carpentier
I was trying to set up a PoC for Passbolt today and came across the documentation for the environment variables
APP_BASEandAPP_FULL_BASE_URL.It would be great to have this clarified with some examples, because I was not sure:
Do I need to set both of them?
APP_BASEto e.g./passbolt/andAPP_FULL_BASE_URLtohttps://example.com/passbolt/?Or is the
APP_BASEautomatically added to theAPP_FULL_BASE_URLvariable?I had lots of funny errors, sometimes links contained
/passbolt/passbolt/..., sometimes the links did contain nothing at all. And I did not find the documentation clear enough to find my way through.If you can explain the basics, I can also come up with a PR.
Thanks in advance!