Open sunsided opened 9 years ago
The baseURL logic in FeedWriter probably needs some tweaks: https://github.com/Daniel15/simple-nuget-server/blob/master/inc/feedwriter.php#L8-L11
Why do you use Apache at the frontend and Nginx as the origin server? That's a really interesting choice. Why not Nginx for everything, or Nginx as the origin and Varnish or haproxy as the load balancer / SSL terminator?
I hear you ... sadly the company I'm working with uses Apache for Subversion access, so that's the front-facing server for the time being. In the Docker container, I'm instead using nginx because nginx.
That said, I just added a patch to the Docker image that simply adds a configurable base URL to all paths in the .conf
file. Works as long as the example config doesn't change. :grin:
EDIT: ... except it doesn't work :neutral_face:
Oh yeah, I remember using Apache for subversion many years ago :smile: Apache really isn't too bad.
I can repro the issue with two slashes when running the NuGet server at the root of a domain. The missing path prefix component (/nginx/
) is more difficult to fix in a general way, as Nginx doesn't know anything about that path at all (it just sees the http://127.0.0.1:16473/blah
path). Does Apache have an option to rewrite URLs in the response? Otherwise you can just have a configurable base URL (like you mentioned you're doing now).
Alternatively you could have it at a subdomain (eg. nuget.my.host.tld
), then the paths will match up :laughing:
Yeah, the subdomain would be my favorite, but sadly that's no option at the moment due to the SSL certificate; I'm basically restricted to a shared "development" subdomain.
On the Apache side, I could imagine passing in the base URL as a X-NuGet-Base
header or something. At the moment I'm getting a friendly (that's fixed)404
on the /nuget/download/...
route with my naive patching approach (which is this one).
This might be part configuration problem on my side and part implementation problem, not sure at the moment. The feed itself runs behind an nginx proxy listening on
localhost:80
and rewriting requests to the PHP files; basically the default example configuration.The nginx runs within a docker container that exposes port
80
as16473
to the docker host, chosen by a fair dice roll. An apache on the host then in turn listens on port443
, terminates SSL and redirects to the container, as perIn this case, requests to
return
which is the wrong protocol (#9) and the wrong path (note the double slash).