Support » Installing WordPress » Problem installing on https

  • I use a reverse proxy server nginx. I have created a domain + tls certificate let’s encrypt. When I configure a reverse proxy with a certificate, the installation is very special. See the following pictures. https://imgur.com/a/AnF0plk
    Configuration file with tls certificate

    
    server {
        server_name my-domain.abc.com;
        return 301 http://www.my-domain.abc.com$request_uri;
    
        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/my-domain.abc.com/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/my-domain.abc.com/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
    
    }
    
    server {
        server_name www.my-domain.abc.com;
    
        location / {
            proxy_pass http://192.168.1.101;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    
        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/my-domain.abc.com/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/my-domain.abc.com/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
    
    }
    
    server {
        if ($host = my-domain.abc.com) {
            return 301 https://$host$request_uri;
        } # managed by Certbot
    
        listen 80;
        server_name my-domain.abc.com;
        return 404; # managed by Certbot
    
    }
    
    server {
        if ($host = www.my-domain.abc.com) {
            return 301 https://$host$request_uri;
        } # managed by Certbot
    
        listen 80;
        server_name www.my-domain.abc.com;
        return 404; # managed by Certbot
    
    }
    

    When I set up a configuration file without a tls certificate (http only), everything works normally.

    
    server {
        listen 80;
        server_name my-domain.abc.com;
        return 301 http://www.my-domain.abc.com$request_uri;
    }
     
    server {
        listen 80;
        server_name www.my-domain.abc.com;
     
        location / {
            proxy_pass http://192.168.1.101;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
    

    I don’t know where the mistake is

    • This topic was modified 6 days, 6 hours ago by janyx.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.