Horror with Docker & Reverse Proxy because of all the paths
See original GitHub issuehey guys, it’s very hard to configure a reverse proxy with docker because nearly every function in papermerge has it’s own path (/upload/, /static/, /nodes/ etc.). It’s even harder if you are running other apps that shares a path with papermerge like /upload/.
My Apache Config looked like:
ProxyPass /papermerge/ http://127.0.0.1:8000/ retry=0
ProxyPassReverse /papermerge/ http://127.0.0.1:8000/
ProxyPass /alltags/ http://127.0.0.1:8000/alltags/ retry=0
ProxyPassReverse /alltags/ http://127.0.0.1:8000/alltags/
ProxyPass /automate/ http://127.0.0.1:8000/automate/ retry=0
ProxyPassReverse /automate/ http://127.0.0.1:8000/automate/
ProxyPass /breadcrumb/ http://127.0.0.1:8000/breadcrumb/ retry=0
ProxyPassReverse /breadcrumb/ http://127.0.0.1:8000/breadcrumb/
ProxyPass /browse/ http://127.0.0.1:8000/browse/ retry=0
ProxyPassReverse /browse/ http://127.0.0.1:8000/browse/
ProxyPass /upload/ http://127.0.0.1:8000/upload/ retry=0
ProxyPassReverse /upload/ http://127.0.0.1:8000/upload/
...
And some functions still doesn’t work. Best solution would be a top-level path like /papermerge/ and then sub-paths for all other functions. This makes Reverse-Proxy configs very easy with 2 lines like this:
ProxyPass /papermerge/ http://127.0.0.1:8000/papermerge/ retry=0
ProxyPassReverse /papermerge/ http://127.0.0.1:8000/papermerge/
I have tested this with many other apps, some of them support Docker Environment Variables to configure this path.
regards
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Reverse Proxies with Nginx Proxy Manager
In this article, we will: Deploy Nginx Proxy Manager as a reverse proxy manager; Show how to reverse proxy docker services, as well...
Read more >Problem with nginx reverse proxy and docker. Only one ...
The idea being to have proxy routes to different projects in docker environments and provide https for all of them/their services. So the...
Read more >Docker reverse proxy using Traefik | Accesto Blog
Common approach to reverse proxy servers in Docker ... Traefik also supports other matchers, f.e. path, but we will take a look at...
Read more >How to handle HTTPS using Nginx, Let's encrypt and Docker
This post will guide you through a step-by-step process to protect your website (and your users) using HTTPS in a docker environment.
Read more >How to set up an easy and secure reverse proxy with Docker ...
by Kasper Siig Introduction Ever tried setting up some sort of server at home? Where you have to open a new port for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
i’m curious why you encounter these problems. are you trying to run an apache2 instance infront of the running container setup? or are you trying to replace the apache2 instances inside the docker-compose setup as it’s being run as an application server via mod_wsgi-express? in the latter case i don’t know, in the former case i’m not sure why you would need all these routes?
tbh i don’t know the apache setup, the corresponding nginx vhost for my setup looks like that:
i understand your use case, of course. just for sake of completeness:
and - of course - one avoids a bunch of “horrible” routing issues 😄
but i do acknowledge that there are different scenarios.