1

I am trying to use AWS API Gateway as a reverse HTTP proxy to front several prototype web applications which are deployed as docker and rails app. Everything seem to be ok but when I access my website with

http://domainname.com/app//privacy/ -> Rails app throw error 404 not found.

http://domainname.com/app/privacy/ -> OK

The having issue with //

If someone know how to fix this problem, please help me out.

aws proxy config:
aws proxy config

Emerson Farrugia
  • 11,153
  • 5
  • 43
  • 51
ncnthuy
  • 19
  • 5
  • 1
    *Rails app throw error 404 not found.* According to [this](https://stackoverflow.com/a/10161264/242520) *HTTP RFC 2396 defines path separator to be single slash.* so `//` looks wrong, and the fact you get a 404 looks right. – ta.speot.is Jan 12 '18 at 04:09
  • 1
    @KenWhite Maybe he just doesn't know that upper case means shouting. – zwcloud Jan 12 '18 at 13:17
  • 1
    @zwcloud: If he doesn't know that the entire internet considers all upper case shouting, it may not be a good idea for him to be writing apps that use the internet. He should also be able to see simply by looking at the main page's list of questions that all caps aren't typically used here, as no one else is doing so. – Ken White Jan 12 '18 at 14:05
  • You can always just normalize and trim the slashes in the rails app. – Abhigna Nagaraja Jan 12 '18 at 21:59
  • A path like `/app//privacy/` should not be *expected* to work, because it makes no semantic sense. You shouldn't have a path that looks like that, for any reason. Perhaps a more appropriate question is why did you try to access your app in this way? It seems like the result of a bug. Additionally, neither of the resources shown in the API Gateway screen shot correspond with this path. – Michael - sqlbot Jan 13 '18 at 00:41
  • Please don't shout in posts here. – halfer Jan 14 '18 at 17:45
  • Thanks all, I have resolved this issue by changed the path `//privacy` to `/privacy` in rails app! – ncnthuy Jan 20 '18 at 03:17

0 Answers0