Giter VIP home page Giter VIP logo

Comments (7)

osoner avatar osoner commented on May 18, 2024

Hi Norman,

You can easily achieve that by changing the nginx configuration, just like;

server {
    listen   80;
    server_name  localhost;

    access_log  off;

    location = /countly/i {
        proxy_pass http://127.0.0.1:3001;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
    }

    location = /countly/o {
        proxy_pass http://127.0.0.1:3001;
    }

    location /countly/ {
        proxy_pass http://127.0.0.1:6001;
        proxy_set_header Host $http_host;
    }
}

Please tell me if I'm missing something.

from countly-server.

rosner avatar rosner commented on May 18, 2024

Already tried that and it didn't work. My guess is that it'll work for the api app since there are no redirects nor static file requests. For example if I use

location /countly
...

and when I'm not logged in then countly redirects to /login and thus getting a 404.
I also tried to redirect rules but that doesn't work either.

An nginx based solution would be fine, but I guess that won't work.

from countly-server.

osoner avatar osoner commented on May 18, 2024

Thats right, API will work fine but the frontend app will have issues since every redirection/post/get is hardcoded there. In order to support this client side javascripts + express/app.js needs to read a configuration value from somewhere.

I think we can add two configs;

  1. frontend/express/config.js: countlyConfig.web.path
  2. frontend/express/public/javascripts/countly/countly.config.js countlyCommon.SERVER_PATH

and perform every operation accordingly. Also countly.install.sh can ask a path from the user during installation and perform the changes in the files automatically.

from countly-server.

rosner avatar rosner commented on May 18, 2024

What do you think about the static files? All static resources are referenced through absolute paths. So this config variable should be also accessable in template/html files.

As I'm new to express: I think that the mountPath option should be exposed to all views that reference assets. I'm trying to figure this out and hopefully provide a PR.

from countly-server.

osoner avatar osoner commented on May 18, 2024

The first thing that I can think of is using a <base> tag inside the html files and remove leading / from each src/url etc. absolute path.

I'll keep you posted if I come up with anything else.

from countly-server.

ubershmekel avatar ubershmekel commented on May 18, 2024

Another thing that needs to be done here is move all images under the css path because of http://stackoverflow.com/questions/2161377/is-the-html-base-tag-also-honored-by-scripting-and-css and here is the suggested solution http://stackoverflow.com/questions/3812375/specifying-base-url-for-css and I think I might have the pull request ready soon.

from countly-server.

ar2rsawseen avatar ar2rsawseen commented on May 18, 2024

Implemented in b657d76
Same server config required as mentioned by @osoner
and also definition in countly config.js files in both api and frontend should define countlyConfig.path = "/countly"

from countly-server.

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.