> ## Content Index
> Fetch the complete content index at: https://blog.esadax.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Enabling SSL and Redirecting HTTP to HTTPS on WordPress with Nginx
- URL: https://blog.esadax.com/en/enabling-ssl-and-redirecting-http-to-https-on-wordpress-with-nginx/
- Published: 2026-11-15T04:16:16.000Z
- Updated: 2026-11-15T04:16:16.000Z
- Author: Esadax 
- Tags: #tr-faq-06-ssl-how-to-enable-ssl-after-purchase, #en, #mdx-imported, FAQ

To set up a redirection from HTTP to HTTPS on your WordPress site using Nginx, follow these organized steps:

1. **Access Nginx Configuration File**: Open the Nginx configuration file for your site, typically located at `/etc/nginx/sites-enabled/000-default.conf`.
2. **Modify Server Block Listen Directive**:
  - Locate the server block that defines your site.
  - Change `listen 80` to `listen 443 ssl;` to ensure Nginx listens on HTTPS port.
3. **Add Redirect for HTTP Requests**:
  - This redirects any request to HTTPS while preserving the domain and path.
4. **Handle Multiple Domains**: If you have multiple domains pointing to your site, ensure each server block includes this redirect or use a wildcard approach if applicable.
5. **Test Configuration**:
  - After making changes, test using `curl` commands or check access logs.
  - Clear Nginx cache if necessary before testing to avoid issues.
6. **Inform Users**: Optionally, notify users about the redirection for their awareness.
7. **Address Mixed Content Warnings**: Implement measures like setting a Content Security Policy to resolve mixed content warnings after ensuring HTTPS redirects are in place.

Within the same server block, add a location block to handle all incoming requests:

```nginx
location / {
    redirect "https://$host$request_uri";
}

```