Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Paths only work if site folder is root #80

Open
ppazos opened this issue Nov 2, 2018 · 1 comment
Open

Paths only work if site folder is root #80

ppazos opened this issue Nov 2, 2018 · 1 comment

Comments

@ppazos
Copy link

ppazos commented Nov 2, 2018

I have a host with a website on the root path and an app on a folder. Need routes to work on the folder (not root in the server), but that folder is the route of the app. The issue is having / as path doesn't work and route needs to be /myapp/ to be able to route to the app root.

I would suggest to add a config var base_folder or something like that and internally manage all routes relative to that path. With current behavior I need to prefix /myapp on every route, and if I move the app to a different folder, also need to rewrite all routes vs. changing one config var.

@wangkiyo
Copy link

wangkiyo commented Aug 5, 2020

location /myapp {
	root "pathto/myapp";
	index index.php;
	try_files $uri $uri/ /myapp/index.php?$query_string;
	if (!-e $request_filename){
		rewrite ^/myapp/(.*)$ /myapp/index.php?s=$1 last;
	}

}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants