There was an error proxying the request (Please help)


#1

Running Zotonic on c9 and got this error:
There was an error proxying the request

error_content:
The request could not be proxied because some headers contained invalid data.

In my Zotonic console I got normal listening on these ports:
14:19:35.416 [info] zotonic:147 Web server listening on IPv4 any:8081, SSL any::8080
14:19:35.737 [info] zotonic:183 Web server listening on IPv6 ::8081, SSL ::8080
14:19:39.253 [info] zotonic_sup:117
14:19:39.253 [info] zotonic_sup:128

This is Zotonic doc about ports (http://docs.zotonic.com/en/latest/ref/configuration/port-ssl-configuration.html

How can I get the log of the proxy?

Thanks in advance for any reply!


#2

This could be because you’re trying to serve the app via https. When previewing Cloud9 applications, the application proxy automatically converts all apps to use https. Because of that, you should use http when serving your app and then you’ll be given https for free.


#3

Thanks a lot! Will try to avoid https.

Yay, it works!
Thanks again!


#4

Alternatively, if you would like to use HTTPS​ anyway, you can have it listen on localhost (127.0.0.1) with HTTPS and terminate early with an NGINX reverse proxy that listens on $IP and forwards from http://127.0.0.1:<port>/. I often do something like this so I can run production code and not worry about the limitations of Cloud9.


#5

Brilliant. I’ve never set this up before but this is indeed nice that you can deploy code without having to remember make that change :thumbsup:


#6

I’m not sure I understand, what you say…
If I understand then - yes, I changed Zotonic config file, make, run and voila :slight_smile:

Sorry for short description, I was excited…

BR