aquatix / digimarks

Simple bookmarking service
Apache License 2.0
20 stars 2 forks source link

Redirect fail with digimarks behinde reverse proxy. #20

Open mnishig opened 4 years ago

mnishig commented 4 years ago

I installed digimarks server behind reverse proxy.

https:// ====> reverse proxt : http:// =====> digimarks

in case, digimarks fail redirect after bookmark adding, editing ....

workaround: these code put in before app.run()

if name == 'main':

run the application

----- from here

from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)

----- to

app.run(host='0.0.0.0', port=9999, debug=True)
aquatix commented 4 years ago

Ah that's an interesting issue. The problem is, 'ProxyFix' will be removed in werkzeug version 1.0.x (the whole of the werkzeug.contrib package will be gone), and I would like to migrate to the latest werkzeug in the future.

You can also change this in the wsgi python file you use when running the Python application?

Also, does this change the functionality of the application when not behind a proxy?

mnishig commented 4 years ago

I'm still starting to learn Python lang. I've never use the wsgi python file, but I 'm trying to write.

My code snippet dose not change functionality. Both, digimarks run right in direct access case and behind R.P.

mnishig commented 4 years ago

Hello again.

I was check running with uwsgi under python3 + venv. This is running with small patch on wsgi.py. and Digimarks run correctly behind reverse proxy

line 6 - 8 is comment out:

# Python3
# with open(activate_this) as file_:
#    exec(file_.read(), dict(__file__=activate_this))

and start digimarrks as bellow:

$ source venvdir/bin/activate $ uwsgi --ini uwsgi.ini:digimarks