Ericsson / codechecker

CodeChecker is an analyzer tooling, defect database and viewer extension for static and dynamic analyzer tools.
https://codechecker.readthedocs.io
Apache License 2.0
2.27k stars 383 forks source link

Support routes for server reverse proxying #3401

Open ryankurte opened 3 years ago

ryankurte commented 3 years ago

Is your feature request related to a problem? Please describe.

It'd be useful to be able to configure the route for the codechecker server to support reverse-proxying, for example: a codecheck server running on localhost:8001 with an nginx reverse proxy managing a collection of services at something.com, routing something.com/codecheck/ to localhost:8001/codecheck/.

Describe the solution you would like

Swap to relative URLs for assets and API calls so the application is route-agnostic (vue's publicPath etc.), thus supporting your standard nginx rewrite:

location /codechecker {
        rewrite /codechecker/(.*) /$1 break;
        proxy_pass http://localhost:8001/;
        proxy_redirect off;
}

Describe alternatives you have considered

It may be possible to pass the external URI through to the codecheck server, allowing reverse proxying without requiring the re-write, however, vue appears to only support setting paths at compile time. Depending on the requirements of the server this may be required either way.

Additional context

Attempting the reverse proxying above to localhost/codechecker results in the index page loading, then the bundled assets being requested from the root (/)

image

szykes commented 1 year ago

Is there any workaround to make it work?