# Passbolt install in a subfolder

**URL:** <https://community.passbolt.com/t/passbolt-install-in-a-subfolder/2885>\
**Category:** Installation Issues\
**Created:** [July 2, 2020, 2:55pm UTC](https://community.passbolt.com/t/passbolt-install-in-a-subfolder/2885 "2020-07-02T14:55:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrPass](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@MrPass](https://community.passbolt.com/u/MrPass)\
**Post date:** [July 2, 2020, 2:55pm UTC](https://community.passbolt.com/t/passbolt-install-in-a-subfolder/2885/1 "2020-07-02T14:55:30Z")

</div>

Hi everyone !  
This is my **first time** on this forum but i really need some help.  
Moreover, my english is not very good, i’ll do my best :).

So, i want to have Passbolt in a **subfolder** of my web server like [http://localhost/passbolt/](http://localhost/passbolt/).  
Because now, i need to have another web site.

However, i do my best in order to fine a solution but it doesn’t work…  
I know, in the official documentation they say : " **Note:** the configuration does not support serving passbolt on a subdirectory fashion. For example, scenarios like [https://mydomain.com/passbolt](https://mydomain.com/passbolt) are not supported by default"

How can i activate this feature?  
I tried to modify this file : “/etc/passbolt/passbolt.default.php”, with ‘base’ =\> ‘/passbolt’. It didn’t work.  
I tried to play with my location in “/etc/nginx/sites-available/default” but no success too…

Can i have some help, cause i really need that.

Best regard.

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [July 5, 2020, 8:55pm UTC](https://community.passbolt.com/t/passbolt-install-in-a-subfolder/2885/2 "2020-07-05T20:55:29Z")

</div>

Hi @MrPass This normally can be handled by the web server, so you’re on the right track. You are using NGINX, so this might help: [https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms](https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms)

It also would be wise to make the other site you have on the server also serve from a unique, established path so there is no confusion. Paths (subfolders) are useful when you have control over the call to the server. Otherwise, you might want to go with a subdomain approach instead.

---

<div class="post-metadata">

**Author:** ![MrPass](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@MrPass](https://community.passbolt.com/u/MrPass)\
**Post date:** [July 6, 2020, 10:21am UTC](https://community.passbolt.com/t/passbolt-install-in-a-subfolder/2885/3 "2020-07-06T10:21:04Z")

</div>

First, thanks for your answer !

This is very helpful.  
However, i have another problem now…

Phpinfo page work at the /, so PHP-FPM is running and the configuration is good.  
At the /passbolt path, the PHP code is not executed but downloaded…

I know that is a problem from PHP-FPM but i don’t know what i am doing wrong.  
Mostly, it works on my root…  
I’ve made some search on the web but nothing works for me.

So, can i have help on this part too?

Cheers

---

<div class="post-metadata">

**Author:** ![garrett](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/garrett/32/545_2.png) [@garrett](https://community.passbolt.com/u/garrett)\
**Post date:** [July 6, 2020, 11:17am UTC](https://community.passbolt.com/t/passbolt-install-in-a-subfolder/2885/4 "2020-07-06T11:17:02Z")

</div>

@MrPass Can you provide your NGINX configuration? And maybe now there are errors in the logs? Found: /var/log/nginx/\*

---

<div class="post-metadata">

**Author:** ![MrPass](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@MrPass](https://community.passbolt.com/u/MrPass)\
**Post date:** [July 7, 2020, 7:31am UTC](https://community.passbolt.com/t/passbolt-install-in-a-subfolder/2885/5 "2020-07-07T07:31:48Z")

</div>

I’ve found a solution, after few days of searching !  
Thanks for your help, i understand how it work the server block and location in NGINX.

First, i will reinstall by sources because the package configure nginx automatically.  
Cause, with the package, when i try to modify passbolt.default.php, this configuration was not loaded.  
So, by sources, i can modify this configuration before that nginx was configured.  
I’ve modified this file : “/etc/passbolt/passbolt.default.php”, with ‘base’ =\> ‘/passbolt’.  
Then i run the install script.

After that, i’ve deleted the nginx-passbolt.default.conf in /var/www/nginx/sites-enabled/ and i put this conf in the default configuration in /var/www/nginx/sites-enabled/:

```auto
[...]
	location ^~ /passbolt {
		alias /var/www/passbolt/webroot; 
		try_files $uri $uri/ @passbolt;

		location ~ \.php$ {
	        include snippets/fastcgi-php.conf;
 			fastcgi_param SCRIPT_FILENAME $request_filename; 
			fastcgi_pass 127.0.0.1:9000;
		}
	}

	location @passbolt {
		rewrite /passbolt/(.*)$ /passbolt/index.php?/$1 last;
	}
[...]

```

And, now I can access to my Passbolt by [http://localhost/passbolt](http://localhost/passbolt) !  
Hope that can help someone else.

Regards ! 🙂

---

<div class="post-metadata">

**Author:** ![remy](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/remy/32/17_2.png) [@remy](https://community.passbolt.com/u/remy)\
**Post date:** [July 8, 2020, 3:15pm UTC](https://community.passbolt.com/t/passbolt-install-in-a-subfolder/2885/6 "2020-07-08T15:15:21Z")

</div>

Thanks for posting your findings!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/passbolt/original/2X/b/bee7d3f9329f668000d46e9fcb2e5db1e9d31348.svg) [@system](https://community.passbolt.com/u/system)\
**Post date:** [July 13, 2020, 3:15pm UTC](https://community.passbolt.com/t/passbolt-install-in-a-subfolder/2885/7 "2020-07-13T15:15:21Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
