Re: [modwsgi] What is expected behavior for proxied HTTPS wsgi requests?

71 views
Skip to first unread message

Graham Dumpleton

unread,
Jul 26, 2012, 5:52:41 PM7/26/12
to mod...@googlegroups.com
Try setting in Apache:

SetEnvIf X-Forwarded-Proto https HTTPS=1

Alternatively see if web2py recognises some specific header from a
front end to identify that proxy actually terminate https and not
http. The headers that some frameworks expect vary as there is no
standard.

Graham

On 26 July 2012 14:42, Andrew Replogle <andrew....@gmail.com> wrote:
> I'm using web2py on OpenShift, Red Hat's PaaS.
>
> In the PaaS there's a primary "edge" Apache server where the ssl terminates
> and then the request gets forwarded to my instance running apache with
> mod_wsgi.
>
> I've noticed that when mod_wsgi passes the request to the handler,
> wsgi.url_scheme is set to 'http' regardless of whether I request it via
> https or http. When using https, I see that HTTP_X_FORWARDED_PROTO is set
> to https.
>
> What is the expected behavior in this type of proxied scenario? Should I
> expect that wsgi.url_scheme should be https? What is used to determine this?
>
> Let me know if there's any other information I can provide about the request
> parameters or environment and if I can I certainly will.
>
> Regards,
> Andrew
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/Kc6FacU6FMEJ.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to
> modwsgi+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.

Andrew Replogle

unread,
Sep 13, 2012, 8:46:46 PM9/13/12
to mod...@googlegroups.com
Thanks Graham, 

Sorry for the delay but just wanted to reply here in case anyone ran into the same issue. 

That fixed it =]

Regards,
Andrew
Reply all
Reply to author
Forward
0 new messages