WordPress / WordPress/Documentation-Issue-Tracker

[Advanced Admin] HTTPS for WordPress using Caddy

Open
#14 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

advanced administration external links
Dominant language
Shell
Stars
109
Forks
73
PR merge metrics
No merged PRs in 30d

Description


Issue Description

Only an Apache example is provided.

URL of the Page with the Issue

HTTPS for WordPress

Section of Page with the issue

Best Practices for HTTPS for WordPress

Why is this a problem?

Examples for other webservers will make this section more useful.

Suggested Fix

Immediately after the text...

It is recommended for all production WordPress sites to use HTTPS.

Use a reputable web host, most provide HTTPS service as a standard.
Use a SSL Certificate from Let’s Encrypt, they are free and easy to use.
Serve Static Content from an SSL enabled CDN
You may need to redirect your HTTP traffic to your HTTPS site. For Apache, you can do so by creating two VirtualHost entries for example:

<VirtualHost *:80>
    ServerName mkaz.blog
    Redirect / https://mkaz.blog/
</VirtualHost>

<VirtualHost *:443>
    ServerName mkaz.blog
    DocumentRoot /home/mkaz/sites/mkaz.blog
    <Directory /home/mkaz/sites/mkaz.blog>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    SSLEngine on
    SSLCertificateFile    /etc/letsencrypt/live/mkaz.blog/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/mkaz.blog/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/mkaz.blog/fullchain.pem
    IncludeOptional /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

Please add the following example for the Caddy webserver.

The Caddy web server activates HTTPS by default for qualifying domain names and automatically enables HTTP → HTTPS redirects. By default, it obtains certificates from Let’s Encrypt and renews them automatically.

example.com { 
    # Set this path to your site's directory:
    root * /var/www/html

    # Enable Gzip compression:
    encode gzip

    # Serve WordPress PHP files through php-fpm:
    php_fastcgi unix//run/php/php7.4-fpm.sock

    # Enable the static file server:
    file_server
}

✍️ Depending on your PHP-FPM config, the php_fastcgi can also be php_fastcgi 127.0.0.1:9000.

Links to relevant resources

  1. The suggested text and code was discussed extensively with Caddy core maintainers in this Caddy forum thread HTTPS for WordPress using Caddy

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the HTTPS for WordPress documentation page and review the “Best Practices for HTTPS for WordPress” section, where the Apache example appears. Add the provided Caddy example and its PHP-FPM note after that text, then verify the documentation renders correctly and clearly explains the Caddy setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.