Project

General

Profile

Wiki » History » Revision 2

Revision 1 (Gareth Eaton, 03/07/2023 05:57 AM) → Revision 2/8 (Gareth Eaton, 03/07/2023 05:59 AM)

h1. Wiki 


 If WordPress is unable to determine when requests are made over HTTPS, causing it to be incapable of serving HTTPS-specific content.  
 Web browsers nowadays usually prohibit loading insecure content within pages that are accessed via HTTPS, which results in predictable issues. 

 See [[SSL Insecure Content Fixer]] 

 The the fix is in wp-config.php add the following, 

 <pre> 
 if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { 
   $_SERVER['HTTPS'] = 'on'; 
 }  
 </pre> 

 And in the NGINX config Add, 

 <pre> 
 server { 
     listen 443; 
     server_name blog.ldev.app; 
     ssl on;       ssl_certificate /etc/pve/local/nginx/ldev-ssl.pem; 
     ssl_certificate_key /etc/pve/local/nginx/ldev-ssl.key; 
     proxy_redirect off; 
     location / { 
         proxy_set_header          Host $host:$server_port; 
         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; 
         proxy_pass http://*YOUR IP AND PORT*; 
     } 
 } 
 </pre> 

 If your using Nginx Proxy Manager point to the root dir in Custom locations, and in the Advanced tab, use the Custom Nginx Configuration below  
 <pre> 
 proxy_set_header          Host $host:$server_port; 
 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;  
 </pre>