This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-05
Channels
- # bangalore-clj (4)
- # beginners (16)
- # boot (4)
- # cljs-dev (1)
- # cljsrn (2)
- # clojure (177)
- # clojure-italy (2)
- # clojure-nl (1)
- # clojure-russia (41)
- # clojure-spec (3)
- # clojure-uk (21)
- # clojurescript (46)
- # code-art (1)
- # datomic (10)
- # hoplon (125)
- # leiningen (1)
- # luminus (2)
- # lumo (1)
- # off-topic (10)
- # onyx (69)
- # re-frame (22)
- # reagent (4)
- # ring (32)
- # rum (6)
- # specter (2)
- # untangled (5)
@weavejester hm. well thank you for your help, i must be having another issue then. i still get https://localhost when trying to access my domain over ze web
Have you ensured that the x-forwarded-for header is set by the proxy, @sova
Have not yet... I'm not sure how I would go about that. you mean by (in this case) apache2 and not by ring/server.clj ?
Yeah, the server you’re proxying from needs to set certain headers. X-Forwarded-For
and X-Forwarded-Proto
I believe.
Although I think the Host
header should be sufficient for the redirect.
Hmm well that's excellent to know, that helps tremendously... now I just gotta find out how to set that up to happen
What are you using as a proxy?
My setup is: lein start
gets a localhost:56162 [some port] going... I have an apache2.4.7 install and I'm just using simple ProxyPass directives to redirect my domain name to localhost:/56162 ...
I just changed something (ProxyPreserveHost) and now I get a different message: site not working, redirected you too many times.
So ProxyPreserveHost sounds like it fixed your Host header problem.
Before, your site was being told that the Host was localhost, hence the erroneous redirection.
Now I suspect that its not setting X-Forwarded-Proto, so your site doesn’t know whether it’s getting HTTPS
So it just gets HTTP each time, and redirects forever.
Ahh okay.
You might need to add:
RequestHeader set X-Forwarded-Proto https
Although if you allow HTTP as well, maybe $scheme
. Not sure how it works in Apache - I usually use nginx.
Dude excellent
I guess in Apache you just set it to “http” on your :80 config, and “https” on your :443 config
Did it work?
I had to enable the request header module using sudo a2enmod headers
and ... now it works.
The site loads over https:// which is sweet!
But my sente sockets are still not working, and my /login page is 403 forbidden via ajax
but hey, thanks a lot for your help thusfar. seems like it just needs a few more tweaks. nginx might be a much better way to go at this point... will see
Not sure how Apache proxies websockets.
I only vague recall how nginx does it. I do remember you need extra configuration for nginx though.
Oh my god
it works
mother-effing stack overflow ftw
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) [P,L]
whatever i never have to look at that file again. i'm glad it works xD
@weavejester thanks a tonnne for your help homie
No problem. Glad you got it sorted 🙂