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

Using the Web App from a Subdirectory on Nginx #145

Open
jradxl opened this issue Mar 1, 2019 · 1 comment
Open

Using the Web App from a Subdirectory on Nginx #145

jradxl opened this issue Mar 1, 2019 · 1 comment

Comments

@jradxl
Copy link

jradxl commented Mar 1, 2019

I have the Web App working fine (I think) in a generic installation in a subdirectory on Nginx except for the On/Off button and Update profile both on top right. The on/off button does nothing (ie no message) and the Update Profile just shows a centre screen rectangle with a permanent busy circle.
I'm not knowledgeable about Laravel applications and wondered if you'd say what might be different about those two menu items, and suggest any improvement to the location clauses shown below.
Of course, it might not be the nginx config, just that the app can't find something or permissions are wrong.
Thanks
(There are nested location blocks below, but they aren't causing an issue - i just need them because of other things on the same server.)

    location ^~ /kba
    {
        location   /kba
        {
            alias   /var/www/nginx/kba/public;
            index  index.php;

            try_files $uri $uri/ @kba;

            location ~ \.php$
            {
                try_files $uri =404; 
                fastcgi_pass   unix:/var/run/php/php7.2-fpm.sock;
                fastcgi_index  index.php;
                include        fastcgi_params;
                fastcgi_param  SCRIPT_FILENAME $request_filename;
            }
        }
    }

    location @kba 
    {
        rewrite   /kba(.*)$   /kba/index.php?$1  last;
    }
@andrestl
Copy link

andrestl commented Apr 3, 2019

I do have the same problem. I would be willing to work on this problem.

I think the product needs a configurable field to set up the front host URL.

example: https://has.mysite.com/frontdoor -> NIGINX -> http://10.0.0.1:8890/<kerberos_io/

Currently, the system builds the pages from 10.0.0.1:8890/<kerberos_io> point of view. This breaks all the link back to the site.

Using proper relative path where possible and front host URL property, It would be possible to run kerberos.io under a single SSL certificate under a subdirectory.

https://has.mysite.com/frontdoor
https://has.mysite.com/backyard

I have tried to do response rewrite of javascript, HTML, etc using sub_filter in NGINX. Almost got it working but ran into a very strange problem within the javascript. I have tried with upstream NGINX 1.14. It was cleaner than using subfilter alone but I ran into subtle problems.

So, Front Host URL would do the trick.

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