mirror of
https://github.com/flyimg/flyimg.git
synced 2026-04-25 09:45:50 +03:00
[GH-ISSUE #190] Proxy pass with NGINX #82
Labels
No labels
Docs
Docs
Docs
Security
UnitTest
bug
dependencies
duplicate
enhancement
enhancement
enhancement
hacktoberfest
help wanted
invalid
pull-request
question
stale
version 1
version 2
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/flyimg#82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yoldar on GitHub (Sep 13, 2018).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/190
Hi! Thank you for that great tool!
I have a question. I'm using Flyimg as microservice as a part of docker-compose.yml. I have one global nginx which routes to each microservice. Flyimg is under /image-optimizer/ path. Here is global nginx config:
The problem is when global proxy passes something like
http://test.test/image-optimizer/upload/w_500,h_500,q_90/https://m0.cl/t/butterfly-3000.jpgit removes double slash from https://
nginx logs from flyimg show this:
"GET /upload/w_500,h_500,q_90/https:/m0.cl/t/butterfly-3000.jpg HTTP/1.0" 500I now that this question is related to nginx community but you are more in context :)
May be you could give an advise?
@baamenabar commented on GitHub (Sep 13, 2018):
This is good use case, thanks for sharing this with us.
My nginx is a bit rusty but I´ll give it a go. @sadok-f ? any ideas?
@baamenabar commented on GitHub (Sep 13, 2018):
@yoldar . can you share a bit more of your nginx config? My quick guess is something else in that config might be stripping the slashes.
But first try adding:
merge_slashes offabove theproxy_passline.I don´t expect it to solve the problem, but we might get lucky.
@sadok-f commented on GitHub (Sep 13, 2018):
Thank you @yoldar for submitting the issue!
Well our demo website is running on nginx as proxy pass to a docker container.
Here the config:
As suggetion maybe try to remove the tail slash in your config to become:
@sadok-f commented on GitHub (Sep 13, 2018):
@yoldar I just reproduce the issue with Nginx, adding the trailing slash cause removing the double slash.
So remove the trailing slash and it'll work!
@yoldar commented on GitHub (Sep 13, 2018):
Thank you all for your replies!
While debugging this issue I have learned how to correctly write nginx rewrite regex rules :)
Solution is here:
@sadok-f commented on GitHub (Sep 13, 2018):
Great to know that you fixed it!
Thank you again for contributing with us!