production mode but without https
# help-with-umbraco
m
Our hosting environment is hosting our Umbraco without https. The https is handled by K8S. Is it possible to run Umbraco in "Production" mode but with UseHttps=false? If I try I get a message that says Umbraco can only run in Production mode when UseHttps is true. https://cdn.discordapp.com/attachments/1331643009221136484/1331643009334247584/image.png?ex=67925cb2&is=67910b32&hm=1653d0788b5fb32949dd807f3eae040b5c7099b6fa0df387002e306246b2ad06&
s
It's not possible, Production mode is our recommendation and it is not designed for K8S hosting (or other kinds of reverse proxy hosting where you can't run on https).
m
Hmm, what's wrong K8S hosting Umbraco? Is it only the Production that would have issues? Right now we have now issues at all running Umbraco in out K8S setup. It runs perfect and fast.
l
Maybe tou can disable the runtime check for https. You can write your own checks and add them with a composition, so it would be a good bet that you could also remove runtime checks.
umbracoBuilder.RuntimeModeValidators().Remove<UseHttpsValidator>();
would seem likely?
m
Thanks, I will give it a try
s
> Hmm, what's wrong K8S hosting Umbraco? Sorry, absolutely nothing wrong with that! We don't "support" it directly, as in we have no documentation and expertise in it. I just meant: the feature Production Mode was not designed for K8S hosting. 🙂
I understand your recommendations. Was just wondering if you have any specific problems with Umbraco + K8S. Our setup is maybe not the common use of K8S. Each (200+) Umbraco application is running with 0 or 1 pod. So no real loadbalancing of Umbraco traffic and scaling. And it is only the backoffice that is in use, not the frontend.
s
I have absolutely no experience running Umbraco in a setup like that, I think you might be the first pioneer.. so.. no idea! 😅
> no real loadbalancing just remember that if 2 or more instances of an Umbraco backoffice connect to the same database then you are by definition load balancing
l
I think you should see the production mode as a way to force best practices. It's mostly a collection of checks at startup which cause Umbraco to fail to start if one of the checks fail. Like I said, you can also write checks yourself. So in your case, I guess the best practice isn't applicable, but it's not like Umbraco doesn't like your situation 😛 Maybe it should have been easier to disable certain checks, maybe there needs to be a flag that says: I'm running behind a firewall, skip some checks. But you have the tools to remove checks if required. And tbh, in 98% of the cases it's probably better to have the 'usehttps' setting enabled and for the other few cases you can disbled them 🙂
s
you can see it in the
umbracoServer
table if more than one are
active
(I believe)
you're right, it's "just" checks that we enforce because we thing it's best practice 🙂 no magic
m
Ahh. So "Mode": "Production" has no effect on how Umbraco runs? It's all the other settings like for example "ModelsMode", "UseInMemoryCache". That is important.
There will only be 1 instance 🙂
l
Not entirely sure, I believe there are SOME optimalisations, but for the most parts it's just checks that force certain settings
s
Production mode itself is just checks that make sure that you deploy with the correct settings. Those settings indeed change how Umbraco works, Production mode just checks that they're all set to best practice and does nothing else.
l
I thought production mode pre-compiles razor files where-as BackofficeDevelopment does not (because they need to be editorable in the backoffice in that case). That's not a setting, right?
s
Think it just tells you to enable the setting for precompiling razor files, but I might be wrong
l
To be fair, it's the only thing I'm not sure about if it's just checking a setting or actively doing something by itself.
s
m
I can confirm that when in Production mode. It is not possible to change templates. There is no error message or notification when trying to save a template. The changes just disappear from the Umbraco Template editor. Maybe the editor should be in read-only mode and/or the [Save] button should be disabled
l
That's weird. In Umbraco 13 it would actively disabled the editor (except in Umbraco forms for some reason :P)
m
Well, looks like a bug report has to be created later today 🙂 Now back to work!
m
though if you are load balancing on purpose and follow best practice to explicitly set serverroles (or disable automatic server election) then entries to that table are stopped 🙂
13 Views