Issue #335 invalid

login - came_from wrong redirect

maciej-sawicki
created an issue

I setup rhodecode to to work with apache revers proxy. This is my apache config (rhodeCode.conf):

{{{

!apache

<Location /hg2 > ProxyPass http://127.0.0.1:5000/hg2 ProxyPassReverse http://127.0.0.1:5000/hg2 SetEnvIf X-Url-Scheme https HTTPS=1 </Location> }}}

{{{

!ini

And in rhodeCode: [app:main] filter-with = proxy-prefix . . . [filter:proxy-prefix] use = egg:PasteDeploy#prefix prefix = /hg2 }}}

When I'm opening http://mydomain.com/hg2 I'm redirected to https://mydomain.com/hg2/_admin/login?came_from=%252Fhg2%252F and when I'm click sign-in button I'm redirected to http://mydomain.com/hg2/_admin/%2Fhg2%2F and getting "Not Found" error. but if I use https://mydomain.com/hg2/_admin/login url everything is O.K.

I use RhodeCode 1.2.3.

Comments (7)

  1. Matt Zuba

    Or change the SetEnvIf line to the following: RequestHeader set X_URL_SCHEME "https"

    The SetEnvIf line only works if your browser sends the X-Url-Scheme header, and even then the wrong variable is being set (bug in the RhodeCode documentation?)

    from rhodecode/middleweare/https_fixup.py

    proto = environ.get('HTTP_X_URL_SCHEME')
    
  2. Log in to comment