Honor value of "server_protocol" #13269

OptimusCrime opened this Issue Jan 28, 2017 · 3 comments


None yet

3 participants

OptimusCrime commented Jan 28, 2017 edited

Current state

Right now, as of MODX 2.x, the setting server_protocol does not do anything (?). The setting has the values http and https. Anyone would expect the choice here to be honored by MODX, but it does not. The actual protocol is fetched automatically by evaluating the request which is done by inspecting various server settings and values.


Sometimes you want to set the value absolute, and sometimes the value is not evaluated correctly by MODX because of various shared host solutions (se relevant issues). Sometimes you also know that you are either always serving everything over http, or you know that everything is served over https.


  • Add a new value (default) that is automatic. Perhaps just call it automatic (?).
  • The automatic value evaluates as best as it can if the request is http or https. This value is needed for sites that is served over both http and https.
  • http value should NEVER allow to serve over https.
  • https value should NEVER allow to serve over http.

Relevant issues

#13259 and perhaps more

@OptimusCrime OptimusCrime changed the title from Honor option of "server_protocol" to Honor value of "server_protocol" Jan 28, 2017

What does Wayfinder et. al. use to determine how to generate full URLs? If it just uses the current automatic settings, you'd end up with all kinds of mixed up URLs because of caching.


The automatic setting it how MODX does things today, as you can not force either http or https automatically. MODX determine if the request is a secure one by doing this: https://github.com/modxcms/revolution/blob/fbf126690f6ce903faeaeb9f1d958211fc2203c9/core/docs/config.inc.tpl#L49-L57

gadgetto commented Feb 1, 2017

+1 for honoring server_protocol setting to override automatic fetching of protocol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment