question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configuration - alternate root path for proxied container deployment

See original GitHub issue

I just set up BaGet using an nginx reverse-proxy to a container, under the location /baget/, so it is accessed at https://example.com/baget - but the interface seems to assume that baget is at the root of the domain.

How can I configure BaGet to know it is not at the root of the domain?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
KelsonBallcommented, Jun 27, 2020

Thank you - solution was to change my sites nginx configuration from

location /baget/ {
            proxy_pass         http://localhost:[BaGet port]/;
            . . .

to

location /baget/ {
            proxy_pass         http://localhost:[BaGet port]/baget/;
            . . .

After successfully adding a package though I can see that the trick for the UI definitely hasn’t fixed everything 😄

1reaction
KelsonBallcommented, Jun 27, 2020

Update - I found a closed PR that appears to have added an undocumented configuration parameter PathBase: #114

Adding PathBase=/baget does not seem to effect my https://example.com/baget/v3/index.json file. I am able to fetch the json file correctly but its data points to the root level https://example.com/api/... instead of the correct https://example.com/baget/api/... paths. As a result, trying to push a package using the dotnet cli fails, because the index.json points at incorrect paths.

Note: I seem to have mostly gotten the UI to work by adding the following to my docker startup script

docker exec -it nuget-server find /app/BaGet.UI/build/ -type f -exec sed -i -e 's/\/static/\/baget\/static/g' {} \;
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to setup a Docker Nginx reverse proxy server example
Start with the official Nginx image ... By default, the Nginx Docker image is configured as a file server, not a reverse proxy...
Read more >
How to handle relative urls correctly with a nginx reverse ...
The problem is basically that using a proxy_pass directive won't rewrite HTML code and therefor relative URL's to for instance a img ...
Read more >
Configuring the cluster-wide proxy - OpenShift Documentation
You can configure OpenShift Container Platform to use a proxy by modifying the Proxy object for existing clusters or by configuring the proxy...
Read more >
Configuring a registry
storage : filesystem: rootdirectory: /var/lib/registry ... you can specify an alternate YAML configuration file by mounting it as a volume in the container....
Read more >
Behind a Proxy - FastAPI
Setting the root_path in the FastAPI app¶ ... Passing the root_path to FastAPI would be the equivalent of passing the --root-path command line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found