Moving a Moodle site to HTTPS: what the switch involves and how much effort it takes
The effort depends on how old the site is, how many links point at HTTP and how much of the site sits behind a proxy or load balancer, so a small site with few embedded links can often be switched in a short window, while a long-running site with many plugins and years of content needs a planned project. The work has four parts: rewriting links already stored in the database and course content, changing the site address (wwwroot) in the configuration, setting up proxy handling where TLS ends at an appliance or load balancer, and finding mixed content, where an HTTPS page still loads HTTP resources. Each part has its own risk, and none of them is finished just because the site loads over HTTPS in a browser.
The documented paths are the core HTTPS conversion tool (tool_httpsreplace), which ships in Moodle core and rewrites embedded links, and the settings in config.php that Moodle's own config-dist.php describes. The config reference says sslproxy should be enabled when an external SSL appliance is used, and it also warns that a site may be reachable over HTTP or HTTPS but not both, so redirects and the stored address have to agree. Before you change anything, confirm with your own environment which URLs the site uses, which plugins write absolute links, and whether a staging copy can be tested end to end. Ask any implementation partner to show the scope of that check in writing.
Ask for a quote that separates the link audit from the cutover. The audit covers a database and content review, the search and replace run, a list of third-party plugins and themes that store their own URLs, and a mixed content scan across representative pages. Cutover covers the configuration change, certificate and redirect checks, and a rollback plan. Both steps recur if you later move the site or change the load balancer, so document the sslproxy and wwwroot decisions with the infrastructure runbook. Confirm the Moodle version you run first, because the document root and supported platform requirements differ across releases.
Which parts of a Moodle site change when it moves to HTTPS
A move from HTTP to HTTPS touches more than the certificate. Stored content, the site address, the proxy configuration and the pages the browser loads all carry addresses that must agree with the new scheme. Each area fails differently, so each needs its own check before cutover.
Stored embedded links in content
Course pages, labels, book chapters and activity descriptions often hold absolute links to images, files and other pages that still start with These sit in the database, so changing the site address does not rewrite them. Find them with the HTTPS conversion tool, which ships in Moodle core as tool_httpsreplace, and review its matches before applying changes. Back up the database first, because the replacement touches stored text.
Moodle admin toolsThe wwwroot site address
The wwwroot value in config.php defines the address Moodle uses to build links, redirects and login callbacks. If it still says users may be redirected back to the insecure address after signing in. Change it to the https:// address and confirm that the domain, port and path match what users type. Test login, logout and a course page from a clean browser session after the change.
SSL proxy setting behind a load balancer
When a load balancer or SSL appliance terminates TLS and forwards plain HTTP to Moodle, the sslproxy setting tells Moodle to generate HTTPS links even though its own connection is HTTP. The config-dist.php guidance says to enable it when using an external SSL appliance. Confirm with your network team which hop terminates TLS, and check that forwarded headers reach the web server as expected.
Site reachable over one scheme only
Moodle's config-dist.php guidance notes that a site may be accessible over http or https but not both. Leaving the old HTTP address open invites duplicate logins, cookie problems and content served on both schemes. Plan a permanent redirect from HTTP to HTTPS at the web server or load balancer, and confirm that the redirect applies to every path users reach.
Mixed content from themes, plugins and external resources
Browsers block or warn when an HTTPS page loads scripts, stylesheets, images or frames over HTTP. The usual sources are a theme with hard-coded asset URLs, a plugin that calls an external service, or an embedded video or widget. Load each major page type in a browser console, record every insecure request, and decide per item whether to fix the source, update the URL or remove the element.
How to sequence the HTTPS conversion with a parallel run and cutover
This sequence moves a Moodle site from HTTP to HTTPS in an order that keeps the live site untouched until a tested copy has passed every check, so the cutover is a rehearsed change rather than an experiment.
Inventory URLs, certificates and the proxy path
Before changing anything, list every place the current site address appears: the wwwroot value in config.php, stored links in course content, block and theme settings, external tool registrations, and any integrations that call Moodle back. Record the certificate authority, the expiry date and who renews it, and map the full request path from the browser through any load balancer, reverse proxy or SSL appliance to the web server. The output is a written inventory signed off by the Moodle administrator and the infrastructure owner. Confirm with your network team whether the appliance terminates TLS or passes it through, because that decides the sslproxy setting later.
Build a test copy of the live site
Create a copy of the code, the database and the moodledata directory on a separate host or hostname that nobody outside the project uses. Keep the test copy on its own HTTPS hostname with a certificate that browsers trust, so it behaves like production. This test copy is where the parallel run happens: the live HTTP site keeps serving users while every conversion step is rehearsed against the copy. The output is a working test site that logs in, loads courses and passes the administration checks, which proves the copy is a valid stand-in for production.
Run the HTTPS conversion tool on the copy
On the test copy only, run the core HTTPS conversion tool (tool_httpsreplace) from the Moodle administration area to find stored http:// references and replace them with https:// equivalents. Review the list of matches before applying any replacement, and note which tables and fields were changed, including course content, blocks and filters. Keep a database backup taken immediately before the run so the replacement can be reversed. The output is a change log for the copy and a list of references the tool did not handle, which you will check by hand in the next step.
Change wwwroot and sslproxy settings on the copy
Update the wwwroot value in config.php on the test copy to the HTTPS address. If TLS terminates at a load balancer or SSL appliance, enable the sslproxy setting as the configuration template describes for external SSL appliances, so Moodle generates secure URLs while the upstream connection remains HTTP. Check the web server configuration to confirm that the site does not answer on both protocols in a way that causes duplicate or inconsistent URLs. The output is a copy that loads only over HTTPS, generates https:// links and reports no redirect loops in the logs.
Test mixed content and integrations on the copy
Load representative pages as a learner, a teacher and an administrator, and check the browser console for mixed content warnings, which indicate http:// assets such as scripts, images, embedded media or iframes. Test single sign-on, external tools, file uploads, email links, cron-driven tasks and any webhook or web service callers against the HTTPS address. Confirm that certificate chains are complete for every client that connects. The output is a dated defect list with each item assigned to an owner, and a retest record showing which items are closed.
Rehearse the cutover on a copy of production
Before the production change, run the full sequence once more from a fresh copy of the live database and moodledata, timing each step and recording every manual action. Include the DNS or load balancer change, the certificate installation and the rollback steps, and confirm that the rollback restores the HTTP site from the backup taken at the start. Have the Moodle administrator and the infrastructure owner sign the runbook. The output is a rehearsed runbook with observed timings and a tested rollback, so the production window contains no untested steps.
Cut over and confirm production
During the agreed window, put the site into maintenance mode, apply the tested changes to production, switch the hostname or load balancer to the HTTPS address and bring the site back online. Verify login, course access, uploads, cron and external integrations, and check the HTTP to HTTPS redirect behavior at the edge. Keep the rollback path open until the business owner accepts the site. The output is a production site serving only HTTPS with a signed acceptance record and a copy of the pre-change backup kept under the retention policy.
Decommission the HTTP endpoint
After acceptance, remove or redirect the HTTP endpoint at the edge, update external links, LTI tool registrations and bookmarks where you control them, and confirm with partners and integration owners that their callers use the HTTPS address. Retire the test copy and its certificate, and record the final configuration in your change system. Confirm with your certificate process that renewal covers the new hostname. The output is a single HTTPS entry point, a closed change record and a documented renewal owner.
Choosing SSL termination: at the load balancer, at the web server or on the Moodle host
With TLS terminated at a load balancer or SSL appliance, the browser speaks HTTPS to the balancer, and the balancer forwards plain HTTP to the Moodle web server on your internal network. Moodle then sees every request as HTTP unless it is told otherwise, which is why the core configuration file says sslproxy should be enabled when an external SSL appliance is used. Set $CFG->wwwroot to the public ` address so that generated links, redirects and cookies use the address users type.
- Enable
sslproxy: set$CFG->sslproxy = true;inconfig.phpso Moodle trusts the forwarded scheme. - Set the public
wwwroot: use the ` address the balancer serves, not the internal host name. - Restrict direct access: make sure the Moodle web server is reachable only from the balancer, since a direct HTTP request would bypass the HTTPS boundary.
- Confirm forwarded headers: check with your load balancer vendor that the scheme and host headers reach Moodle as you expect.
- Plan certificate renewal: certificates live on the appliance, so renewal and monitoring belong to the network team.
Before choosing this path, confirm with your network or cloud team which device holds the certificate, how it forwards headers, and whether it can serve HTTP and HTTPS to Moodle at the same time.
When Apache or Nginx on the Moodle host terminates TLS, the connection is encrypted from the browser to the same machine that runs PHP. Moodle receives HTTPS requests directly, so sslproxy is normally left off, and the main job is a correct virtual host with the certificate, a redirect from HTTP, and a wwwroot that matches the public name. This is the simplest model to reason about when there is one web node.
- Leave
sslproxyoff: Moodle detects HTTPS from the request itself in this design. - Set
wwwrootto HTTPS: point it at the public ` address so links do not fall back to HTTP. - Redirect HTTP to HTTPS: configure the web server to send port 80 traffic to the secure address.
- Point the document root at
/public: from Moodle 5.1, the web server document root must be the new/publicdirectory. - Manage certificates locally: renewal and key storage are handled on the host, so include them in your patch and backup routines.
Confirm that your Moodle version and PHP version support the planned web server layout, and check the document root against the release notes for your target Moodle version.
Some estates place a reverse proxy, such as a container ingress or a shared edge proxy, in front of a Moodle host that also serves TLS. The public connection is encrypted at the edge and may be re-encrypted to the host, which gives two hops that each need a scheme decision. The configuration is only correct when every hop agrees on which scheme the user used and which scheme Moodle should generate.
- Map each hop: write down where TLS starts and ends, and whether traffic between the proxy and Moodle is encrypted.
- Choose
sslproxyfrom the last hop: it is only correct when Moodle receives plain HTTP from the component directly in front of it. - Avoid redirect loops: a proxy that forces HTTPS while the Moodle host also redirects can loop, so test both paths.
- Keep one
wwwroot: it should match the public address, not the address of an internal node. - Document the chain: auditors and the next operator will need the full path to understand the setup.
Ask your platform team whether the ingress or edge proxy is managed by them or by a cloud provider, and whether they can supply the forwarded-scheme headers Moodle will read.
HTTPS conversion items: what the tool covers and what needs manual work
This table maps each item in an HTTP to HTTPS move to either the core conversion tool or a manual check. Read it as a checklist: anything marked as a manual item stays with your team, because the tool will not find it. The main takeaway is that the tool handles stored content links, while the configuration and external references still need your review.
| Item | Handling | What you must check |
|---|---|---|
| Embedded links in stored content | Covered by the HTTPS conversion tool (tool_httpsreplace) in core | Run the tool, then confirm that course pages, labels and resources open without browser warnings |
| wwwroot setting | Changed by you in the config file, not by the tool | Confirm the scheme and host match the public address exactly, including any redirects from the old HTTP address |
| sslproxy behind an SSL appliance | Set by you in config when TLS ends at a load balancer or appliance | Check that the site accepts the proxy's forwarded traffic and that the appliance, not Moodle, handles certificates |
| Site reachable over HTTP and HTTPS | Not a supported state according to the config template | Decide on a single scheme and redirect the other to it at the web server or load balancer |
| Hard-coded links in custom themes | Not covered by the tool | Search theme templates, stylesheets and images for http:// references and fix them by hand |
| Plugin settings with stored URLs | Not reliably covered by the tool | Review plugin configuration pages and database values that store full URLs, such as external tool or media settings |
| External embeds and third-party content | Not covered, and the content source controls its own scheme | Confirm each external provider serves HTTPS, and replace or remove embeds that still load over HTTP |
| Mixed content warnings | Not fixed by the tool | Load key pages in a browser, check the console for blocked HTTP requests, and retest after each fix |
| Cached and emailed links | Not covered by the tool | Clear caches after the change and confirm notification emails and external bookmarks use the new address |
Questions buyers ask before moving a Moodle site to HTTPS
How much effort does converting a Moodle site to HTTPS take?
The effort is usually a bounded change to configuration and stored content, but it is not a one-line edit. The work covers certificate and load balancer setup, changing the wwwroot value, setting SSL proxy options where TLS ends before Moodle, running the HTTPS conversion tool (tool_httpsreplace) against stored links, and checking the pages that still load insecure resources. Most of the time goes to finding and testing the places where old ` addresses still appear, not to the configuration change itself. Ask for a written list of those steps for your environment before agreeing a scope.
What drives the cost of an HTTPS conversion up or down?
The main drivers are how the site is reached and how much content references it. A site with a single web server and a certificate it already manages is simpler than one behind a load balancer, an external SSL appliance, or several hostnames. Heavy use of embedded media, third-party plugins that store absolute URLs, custom themes with hard-coded assets, and a large course catalog all add testing. Cost also rises when the team must coordinate with network, DNS or certificate owners who sit outside the Moodle team. Ask any provider to price each of these drivers separately in the quote.
What must our team provide before the HTTPS conversion starts?
Provide access and facts before work begins, because most delays come from missing information. The list typically includes:
- Read access to the Moodle
config.phpfile and the web server configuration for the site - The certificate source, the hostname, and who renews and installs certificates
- Load balancer or reverse proxy details, including which headers it sends and where TLS ends
- A database backup, a moodledata backup, and a maintenance window agreed with the business
- A list of installed plugins and any custom themes or code that store absolute URLs
Confirm the exact access model and change approval steps with your own security team.
Can our internal team convert Moodle to HTTPS without a partner?
Yes, a capable internal team can do this, provided it has someone who can edit the Moodle configuration, manage the web server or proxy, and run the conversion tool with a tested backup in place. The tool and the configuration settings are part of Moodle core, so the work does not need a vendor license. The risk lies in judgment calls: deciding whether TLS terminates at the load balancer, handling plugins that store URLs in ways the tool does not reach, and verifying mixed content across themes and course pages. Internal teams often choose to bring in a partner for testing, a second review, or capacity during a change window.
How long does testing take for an HTTPS conversion?
Testing time depends on the number of courses, the number of content types, and the plugins in use. A small site with standard activities and no custom themes needs a shorter test cycle than a large site with many external media embeds, custom plugins and integrations that call Moodle over HTTP. Plan testing across these areas: sign-in and SSO redirects, course pages with embedded media, file downloads, web service callbacks, scheduled tasks, and email links. Ask the provider to state the test cases and the number of test cycles they include, and to name which of these were checked on your own environment rather than a copy.
What does a rollback look like if the HTTPS change fails?
A rollback reverts the wwwroot value, the SSL proxy settings, and the web server or load balancer configuration to the last known working state, then restores any database content changed by the conversion tool from a backup taken before the change. Because the conversion tool rewrites stored content, a file-level or database-level restore is the reliable path, not a reverse search and replace. Before the change, confirm the backup restores cleanly into a test environment, record the exact previous configuration, and agree who makes the call to roll back within the maintenance window.
Should we run the HTTPS conversion on a copy of the site first?
Yes, a staging copy is the safest way to find problems before they reach learners. A copy of the database, moodledata and code lets the team run the conversion, check mixed content, and test sign-in without affecting live courses. The copy should use the same PHP and database versions, the same plugins, and a similar proxy setup, otherwise the results will not match production. For the version and server requirements that apply to your release, check the official Moodle release notes, such as the Moodle 5.1 release notes, before choosing the target environment.
How browser traffic reaches Moodle through the load balancer after the move
The request starts in the browser over HTTPS and terminates at the load balancer or SSL appliance, where the sslproxy setting in config.php must be enabled. The load balancer then forwards to the web server, whose document root is the public directory, and Moodle reads and writes the database and moodledata. Check that every hand-off keeps the same scheme, and that the site is reachable over HTTPS only.
Traffic path from browser to Moodle, with the SSL termination point marked.
Mixed content and link checks that catch problems after cutover
The HTTPS conversion tool only fixes what it can find in the database, so the checks in this section decide whether the move is actually finished. Run them on a test copy before cutover, then repeat them after the first real traffic reaches the new address. The places to search are database content (course pages, labels, book chapters, forum posts, block HTML), the theme (custom CSS, Mustache templates, logos and favicons hard-coded in theme settings), and plugin output that builds URLs at runtime or stores them in its own tables. Start with a full-text search for and your old hostname across the database and the moodledata folder, then compare the results with what tool_httpsreplace` reports, since anything left over is a candidate for manual review.
Browser checks catch what a database search misses. Load the front page, a course page, a quiz attempt, a gradebook view and a file download while the developer console is open, and filter for mixed content warnings and blocked requests. Mixed content usually comes from external embeds, scripts loaded by a plugin, or a stale absolute URL in JavaScript. Also check the login redirect, the logout redirect and any SSO callback URL configured in your identity provider, because these are often set outside the database. Confirm the sslproxy setting matches your load balancer or SSL appliance, since a wrong value produces redirect loops or insecure links that look correct in a single test. Ask your Moodle administrator or partner to confirm which plugins build their own links, because those need individual testing rather than a global search.
After cutover, repeat the scan of the live database and the browser checks, because new content, cached pages and users with bookmarks generate HTTP references that did not exist on the test copy. Watch the web server access logs for requests to old HTTP paths and for redirect chains, and check the Moodle logs for errors from plugins that fail when a resource is no longer reachable. Plan who owns these checks for the first few days of live use and what they do when a link fails, including whether a broken external resource is fixed in content or left for the course owner. The first live traffic is the first real test of the proxy headers and certificate chain, so treat the second scan as part of the cutover, not as routine maintenance.
What usually goes wrong in an HTTPS move and how to prevent it
Most HTTPS problems on a Moodle site come from a handful of settings that were correct for HTTP and no longer match the new address. The risks below sit in the proxy configuration, the browser, stored content and the certificate chain, so each one needs its own check before cutover. Test each prevention step on a staging copy before changing the live site.
Redirect loops from sslproxy
A redirect loop usually means Moodle thinks the connection is plain HTTP while the load balancer or SSL appliance has already terminated TLS and forwards HTTP to Moodle. Config-dist.php says $CFG->sslproxy should be enabled when an external SSL appliance is in use, so check that the flag matches your actual topology. Confirm that $CFG->wwwroot starts with ` and that the proxy sends the forwarded protocol header Moodle expects. Test the login page and the admin pages after each change, because a loop may only appear on certain paths.
Mixed content blocking scripts and media
Browsers block HTTP scripts, stylesheets and embedded media on an HTTPS page, so pages can load with broken JavaScript, missing images or empty video players. Themes, course pages and HTML blocks often hold hardcoded ` URLs that a database search does not always catch. Load representative pages in a browser console, look for mixed content warnings, and check third-party embeds such as video or H5P content hosted on another domain. Fix the source links rather than adding exceptions in the browser.
Stale HTTP links in stored content
Course text, forum posts, resources and block content keep whatever links their authors inserted, so old addresses survive a wwwroot change. The HTTPS conversion tool in Moodle core (tool_httpsreplace`) is designed to find and update these embedded links, and it should run after the wwwroot change and after a verified database backup. Review its output for links to external hosts that you cannot change, and record them for the course owners. Run it on staging first and keep the report.
Certificate chain gaps
A certificate that is valid for the hostname can still fail in some browsers, mail clients and API clients if the server does not send the intermediate certificates. Calls from Moodle to external services, such as web service integrations or LTI tools, can fail even when the browser shows a green padlock. Check the full chain with an external TLS test from outside your network and from the server itself. Confirm that the certificate covers every hostname users and integrations use, and set a renewal process before expiry.
Session and cookie mismatches
Session cookies set for the HTTP address may not be sent to the HTTPS address, which can log users out in a loop or break sign-in through an identity provider. Moodle's cookie and session settings, and any SSO plugin's callback URLs, must use the new https address. Clear existing sessions after cutover, update the redirect URIs registered with each identity provider, and test sign-in with a real user account in each authentication method in use. Plan a short announcement, since some users will need to sign in again.
Certificate renewal after go-live
HTTPS conversion is often treated as a one-time job, yet certificates expire and the new settings depend on a working certificate process. If renewal is manual, the site can fail weeks later with the same symptoms as a broken chain. Confirm who owns certificate renewal, where the certificate is stored, and whether the load balancer or web server reloads it without a restart. Add an expiry alert that reaches the platform team before the certificate expires.
How DeployOpen scopes and delivers a Moodle HTTPS conversion
DeployOpen approaches moving a Moodle site to HTTPS as a scoped change to a live learning platform, starting with an inventory of the site's URLs, proxies and embedded content. The work is planned in your own infrastructure, with the cutover, testing and handover agreed in writing before any change is made.
How we scope
- Inventory the current wwwroot, certificates, load balancer or SSL appliance, and how users reach the site today.
- Identify course content, blocks and plugins that store absolute http links and may need conversion.
- Agree the written scope, cutover window, rollback point and who signs off each stage before work starts.
How we build
- Configure the HTTPS endpoint, redirects and the SSL proxy settings that match your proxy or appliance design.
- Run the core HTTPS conversion tool against a copy of the database in a staging environment first, reviewing each replacement.
- Test mixed content, login, file downloads, embedded media and cron on staging, then repeat the checks after cutover.
How we hand over
- Document the final configuration, certificate renewal steps, proxy settings and the list of changed content links.
- Provide a test record covering pages, embedded content and external integrations, with any remaining items listed by owner.
- Walk your platform, network and course support teams through the changes and the rollback procedure.
How we support
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer after the conversion is complete.
- Confirm with your team which integrations, plugins and third-party hosts need checks after each Moodle upgrade.

