exodus4d / pathfinder

Mapping tool for EVE ONLINE
https://www.pathfinder-w.space
MIT License
385 stars 251 forks source link

Subdirectory NGINX Testing #731

Open chiefdan opened 5 years ago

chiefdan commented 5 years ago

Testing subdirectories with nginx and I'm having some issue.

http://pathfinder.some.domain/subdir/

gives a 404 error from nginx, while

http://pathfinder.some.domain/subdir/setup

opens the setup page as expected.

when adding "index index.php;" to the /subdir location block, the main page loads and I can get redirected and logged in through EVE sso, but upon return the redirect to

"http://pathfinder.some.domain/subdir/map"

gives a 404 error from the app

I'm thinking it may be something with the rewrite, I'm not 100% on the syntax since i've mostly worked with netscaler for url maniplation. I'd welcome any thoughts or assistance.

Here are my location blocks for reference.

location /subdir { alias /var/www/pathfinder2; try_files $uri $uri/ @subdir; location ~ .php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; } } location @subdir { rewrite /subdir/(.*)$ /subdir/index.php last; }

chiefdan commented 5 years ago

I got a little further realizing that

fastcgi_split_path_info ^(.+.php)(/.+)$;

was missing. Now I am still seeing some 404 on the /map request, I've narrowed it further, the 404 is in response to some GET http://pathfinder.some.domain/api/map/stuff but it looks like the /subdir is missing from there.

GT4 commented 5 years ago

Hello. I have the same issue with api calls.

extract from serverlog (install is in /pathfinder) 192.168.1.16 testsrv.local - [10/Jan/2019:19:13:24 +0100] "POST /api/user/getEveServerStatus HTTP/1.1" 404

i think the fix for #706 was a good start but maybe not thorough enough ? f.ex https://github.com/exodus4d/pathfinder/blob/3fee2235c62dca8fe8aa30fa4fe1969ea87f0447/public/templates/admin/settings.html#L12 is hardcoded (missing {{ @base }} ), same for https://github.com/exodus4d/pathfinder/blob/3fee2235c62dca8fe8aa30fa4fe1969ea87f0447/public/templates/ui/footer.html#L3

i guess api urls are also hardcoded and missing the @base part ?

pezz commented 5 years ago

I gave up trying to get PF working in a sub dir, things I noticed: