On 5 Jun 2016, at 18:44, Propadovic Nenad wrote:
> Our nginx correctly sets the X_FORWARDED_PROTO header to https, but it
> looks like your backend server ignores it, so I've set the
> trusted_proxy
> value to nginx's address as per the above line in your development.ini
> file
> and it looks like it is working now.
>
> From their answer I read both that they think Kotti should recognize
> it is
> served behind https, but it does not, and that this is Kotti (or
> Pyramid)
> want it to be: no https without stating the trusted proxy.
I've never needed to do this. This is an excerpt of a nginx
configuration for a Kotti site served with waitress behind nginx over
HTTPS (which should be quite similar to what you do / Webfaction does):
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> Am Sonntag, 5. Juni 2016 13:00:16 UTC+2 schrieb Propadovic Nenad:
>>
>> To add an assumption: I think this is somehow related to Kotti not
>> even
>> knowing that it is served with https.
Right. It doesn't need to. See below.
>> I think so, as I see that the url
>> behind the menue antry (Yet another Kotti site) is: "
>>
http://mypyramid.propad.webfactional.com/", and when I click on it, i
>> get
>> nowhere ("Coming soon: Another fine website hosted by WebFaction
>> <
http://www.webfaction.com/>")...
You should never do anything like that. Kotti uses Pyramid's
request.resource_url(context, ....) method to generate URLs. If the
generated URLs are not what you expect them to be, it's safe to assume
that there is a problem with your web server configuration.
>>> Is there a way to tell Kotti to prepend "https://" instead of
>>> "http://"?
Please note that all of this is plain Pyramid. Kotti itself does
absolutely nothing w.r.t. URL generation, it only uses Pyramid for that.
HTH,
Andreas