Giter Club home page Giter Club logo

Comments (12)

tonkolviktor avatar tonkolviktor commented on July 27, 2024

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on July 27, 2024

I do not have a good overview, but what is crucial is that the controller redirect should use this path for the internal redirects.

Controller::redirectTo() method use MPG_BASE_URL constant which is based on $_SERVER['REQUEST_URI'] variable. See [1]. So I don't understand why redirect fails. Could it be related to reverse proxy behavior?

[1] https://github.com/SamuelTS/MongoDB-PHP-GUI/blob/8ebe226905bbc5fb2d436ef398d6310b8dcd505f/index.php#L38-L40

from mongodb-php-gui.

patrickdk77 avatar patrickdk77 commented on July 27, 2024

instead of using full paths and server names. just 7se realative url. dont use / anywhere at the start but just index.php or subdirectory names. if i find time ill look at coding a pr

from mongodb-php-gui.

tonkolviktor avatar tonkolviktor commented on July 27, 2024

I've done some testing. I've realized that the problem is not the context, but the HTTP_HOST.

When this parameter is missing from the ngnix reverse_proxy then the host is the local hostname not the reverse_proxy host name:
proxy_set_header Host $http_host;

Since in our environment pushing through a change like that is time consuming, I've did a workaround, which is not the nicest, but works :)
tonkolviktor@af4e437

For the main product probably @patrickdk77's point is the best.

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on July 27, 2024

@tonkolviktor You don't need to move files to api/mongo-ui folder anymore?

Could you please do a dirty test?
Replace this line:

define('MPG_BASE_URL', $baseUrl);

by this line:

define('MPG_BASE_URL', $serverPath);

Maybe we can omit the host and use MPG_SERVER_PATH instead of MPG_BASE_URL everywhere in code.

PS: I think it's safer to keep absolute paths.

from mongodb-php-gui.

tonkolviktor avatar tonkolviktor commented on July 27, 2024

@SamuelTS thanks I did.
Hm, at least the static files I still have to move, right?
Maybe they need an extra route or something, but for me they fail:

HTML:
<script src="/api/mongo-ui/static/js/mpg.login.js"></script>
Log:
GET /api/mongo-ui/static/js/mpg.login.js - No such file or directory

from mongodb-php-gui.

tonkolviktor avatar tonkolviktor commented on July 27, 2024

Additionally I'm getting now a session problems, but this could be because one of my changes.

image

PHPSESSID cookie is set and sent.

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on July 27, 2024

Hm, at least the static files I still have to move, right?

Yes. But it wasn't required previously? I'm lost 😆

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on July 27, 2024

Additionally I'm getting now a session problems, but this could be because one of my changes.

You should not debug with print [1]. This could cause issues. I think error_log is a better option.

[1] https://github.com/tonkolviktor/MongoDB-PHP-GUI/blob/7eaf05b551adc1883275c92480c92c21e341388a/src/Controllers/LoginController.php#L72

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on July 27, 2024

@tonkolviktor I've released a version. Routing code is cleaner. This should not resolve your issue, but I encourage you to upgrade anyway.

from mongodb-php-gui.

tonkolviktor avatar tonkolviktor commented on July 27, 2024

@SamuelTS thanks!
A summary from my side is that the reverse proxy setup works.

I cannot fix the session problem that I'm having, which means unfortunately I cannot continue. However that must be something in my environment.

Thanks for the quick reply and action to make the reverse proxy work, hopefully it will be useful for someone else. From my side feel free to close the issue.

ps.: I wanted to clear one point before a deployment in a separate issue, but unfortunately that will not be relevant for me anymore. Still here it is: I could not find License information only [1], I would not know how to understand this. It would be nice to clarify what can be done with your code, like: https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/licensing-a-repository

[1]

Copyright
© 2021 Samuel Tallet

from mongodb-php-gui.

SamuelTallet avatar SamuelTallet commented on July 27, 2024

@tonkolviktor You're welcome. This project is licensed under GPL v3.

from mongodb-php-gui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.