Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to specify application base URL #155

Closed
luismsgomes opened this issue Jun 29, 2016 · 1 comment · Fixed by #250
Closed

option to specify application base URL #155

luismsgomes opened this issue Jun 29, 2016 · 1 comment · Fixed by #250

Comments

@luismsgomes
Copy link
Contributor

luismsgomes commented Jun 29, 2016

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?

@ankostis ankostis self-assigned this Jun 29, 2016
@ankostis
Copy link
Member

ankostis commented Jul 2, 2016

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.

ankostis added a commit to ankostis/pypiserver that referenced this issue Jul 2, 2016
ankostis added a commit to ankostis/pypiserver that referenced this issue Jul 2, 2016
+ tests: drop TC for relative URLs introduced for pypiserver#25;
  Checked apache-2.4 & mod_wsgi and works correctly now.
ankostis added a commit to ankostis/pypiserver that referenced this issue Jul 2, 2016
+ tests: drop TC for relative URLs introduced for pypiserver#25;
  Checked apache-2.4 & mod_wsgi and works correctly now.
ankostis added a commit to ankostis/pypiserver that referenced this issue Jul 2, 2016
ankostis added a commit to ankostis/pypiserver that referenced this issue Jul 2, 2016
+ tests: drop TC for relative URLs introduced for pypiserver#25;
  Checked apache-2.4 & mod_wsgi and works correctly now.
ankostis added a commit that referenced this issue Jul 2, 2016
ankostis added a commit that referenced this issue Jul 2, 2016
ankostis added a commit to ankostis/pypiserver that referenced this issue Jul 2, 2016
+ Aboted because BETTER FAIL EARLY, and have user discover the problem
from the welcome-page.
+ tests: drop TC for relative URLs introduced for pypiserver#25;
  Checked apache-2.4 & mod_wsgi and works correctly now.

[ci skip]
@ankostis ankostis added this to the No Action milestone Jul 2, 2016
luismsgomes pushed a commit to luismsgomes/pypiserver that referenced this issue Feb 15, 2017
@ankostis ankostis closed this as completed Dec 3, 2017
@mplanchard mplanchard mentioned this issue May 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants