pypiserver / pypiserver

Minimal PyPI server for uploading & downloading packages with pip/easy_install

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

option to specify application base URL

luismsgomes opened this issue · comments

Started pypiserver on port 127.0.0.1:8001 as follows:

$HOME/.pyenv/shims/pypi-server \
  --interface 12.0.0.1 --port 8001 \
  --authenticate update,download \
  --passwords $HOME/pypiserver/htpasswd.txt \
  --log-file $HOME/pypiserver/log.txt -vv \
  $HOME/pypiserver/packages

Then tried to reverse proxy the application through apache as follows:

ProxyPass  "/pypi/"  "http://127.0.0.1:8001/"

I can access the welcome page at the front-facing address /pypi/ but the URLs in that page are wrong:
/simple should be /pypi/simple

Is it possible to add an option to pypi-server --app-root=/pypi/ so that all URLs are prefixed with the given URL?

Unfortunately this is not as simple as it sounds since all urls are affected (see also #25, #100 & #123).

  • Maybe a better configuration is to use mod_wsgi as described in the recipes.
    That way you get also multi-threaded responses for free.
  • [edit:] Another option is to use Apache's mod_proxy_html module which is exactly for this task.
  • edit:] For completing the subject, if possible, using a <VirtualHost> with a different DN and serving everything from / avoids this problem.

Providing feedback on your attempts to fix the problem here is not waste of bandwidth, actually it is highly appreciated for improving the recipes.