Open Tedlar opened 4 years ago
@Tedlar, you don't need additional context path to configure application behind reverse-proxy. There is example docker-compose.yml with traefik v2 as reverse proxy. No problem to configure using apache or nginx.
Still I have configuration problem. On host machine I have already few applications. Those applications are standing behind revers proxy (nginx) so I can access all of them through standard http(s) ports. So http://my.server.com/app1 -> http://my.server.com:8000 I would like to have same configuration for your syncing app.
@Tedlar, could you show me your reverse proxy configuration?
@hlavki no problem.
location /auth {
rewrite ^auth(.*) /$1 break;
proxy_pass http://localhost:8183;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
@Tedlar I am not NGINX expert, but couple of thoughts:
location /auth/ {
proxy_pass http://localhost:8181;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Nope, not working. All css and js files are being fetched using wrong path (without '/auth'). I also added configuration:
location / {
if ($http_referer ~ "^https?://[^/]+/auth"){
rewrite ^/(.*) http://$http_host/auth/$1 redirect;
}
}
Thanks to that application is being loaded properly. Still 'Redirect url' is messed up. Damn.
@hlavki For now i moved your app to base url ('/') and everything works. I hope that in near future I will be able to move it to proper path ('/auth/')
yes, I understand your problem. I will let you know if I found some solution.
I think it would be a great feature to add ability to configure web applications context-path (base path). Of course as variable passed to docker container. So you could change base url from: http://localhost:8181 to: http://localhost:8181/new-context
It would enable placing application behind reverse-proxy.