2

We use nginx as proxy for our play framework 1.2.7 server. Some of the routes in play framework use a <.*> wildcard, the one in question here looks like

GET /media/{bucket}/{id}/inline/{<.*>config} MediaCtl.getMediaInlineImgIx 

The config can contain a http server and for some reason nginx strips away one of the / in http:// . For example:

13:07:59,299 INFO [play] ~ Anonymous Guest ~ MediaCtl.getImgIx(): config {"w":100,"h":65,"origin":"http:/localhost:8080","fit":"max"} 

when using nginx via localhost:8080. When calling localhost:9010 directly I get

13:19:25,648 INFO [play] ~ Anonymous Guest ~ MediaCtl.getImgIx(): config {"w":100,"h":65,"origin":"http://localhost:9010","fit":"max"} 

I see no messages in access.log or error.log with regards to the URL mangling that seems to occur. Any suggestions on how to fix this?

2
  • this /media/{bucket}/{id}/inline/{<.*>config} route is obviously what your app is listening for. what URL is actually being requested of nginx when the problem happens? Commented Oct 19, 2015 at 11:46
  • This would be a URL asked for: localhost:8080/media/images/54cbaf853004fd6a7b5026ce/inline/… Commented Oct 19, 2015 at 11:57

1 Answer 1

2

nginx merges slashes from URLs on default see: http://nginx.org/en/docs/http/ngx_http_core_module.html#merge_slashes

You must use: merge_slashes off;

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.