ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Wordpress Install - Page is trying to load unsafe script

    IT Discussion
    fedora 27 nginx wordpress
    4
    28
    4.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JaredBuschJ
      JaredBusch
      last edited by

      WP is a bitch about this when running behind a proxy.

      1 Reply Last reply Reply Quote 0
      • NashBrydgesN
        NashBrydges
        last edited by

        Thanks @Tim_G that shows this...

        http://domain.com/blog/wp-content/themes/twentyseventeen/assets/images/header.jpg
        

        Wonder why that image would be served via http even though the site redirects all http tp https.

        1 Reply Last reply Reply Quote 0
        • NashBrydgesN
          NashBrydges
          last edited by

          When I "inspect element" with Chrome, I see these issues:

          Mixed Content: The page at 'https://domain.com/blog/wp-login.php?redirect_to=http%3A%2F%2Fdomain.com%2Fblog%2Fwp-admin%2F&reauth=1' was loaded over HTTPS, but requested an insecure script 'http://domain.com/blog/wp-admin/load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate&ver=4.9.4'. This request has been blocked; the content must be served over HTTPS.
          
          Mixed Content: The page at 'https://domain.com/blog/wp-login.php?redirect_to=http%3A%2F%2Fdomain.com%2Fblog%2Fwp-admin%2F&reauth=1' was loaded over HTTPS, but requested an insecure script 'http://domain.com/blog/wp-content/plugins/better-wp-security/core/modules/strong-passwords/js/script.js?ver=4087'. This request has been blocked; the content must be served over HTTPS.
          
          Mixed Content: The page at 'https://domain.com/blog/wp-login.php?redirect_to=http%3A%2F%2Fdomain.com%2Fblog%2Fwp-admin%2F&reauth=1' was loaded over HTTPS, but requested an insecure stylesheet 'http://domain.com/blog/wp-admin/load-styles.php?c=1&dir=ltr&load%5B%5D=dashicons,buttons,forms,l10n,login&ver=4.9.4'. This request has been blocked; the content must be served over HTTPS.
          
          Mixed Content: The page at 'https://domain.com/blog/wp-login.php?redirect_to=http%3A%2F%2Fdomain.com%2Fblog%2Fwp-admin%2F&reauth=1' was loaded over a secure connection, but contains a form that targets an insecure endpoint 'http://domain.com/blog/wp-login.php'. This endpoint should be made available over a secure connection.
          
          Mixed Content: The page at 'https://domain.com/blog/wp-login.php?redirect_to=http%3A%2F%2Fdomain.com%2Fblog%2Fwp-admin%2F&reauth=1' was loaded over HTTPS, but requested an insecure stylesheet 'http://domain.com/blog/wp-admin/load-styles.php?c=1&dir=ltr&load%5B%5D=dashicons,buttons,forms,l10n,login&ver=4.9.4'. This request has been blocked; the content must be served over HTTPS.
          
          1 Reply Last reply Reply Quote 0
          • ObsolesceO
            Obsolesce
            last edited by

            Also, in your WP settings page, verify these are "https":

            0_1520979661167_e79ea302-916b-47a5-b20c-f883c6260a9d-image.png

            NashBrydgesN 1 Reply Last reply Reply Quote 3
            • ObsolesceO
              Obsolesce
              last edited by

              Try adding this to the bottom of wp-config.php:

              if($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
              
                  $_SERVER['HTTPS'] = 'on';
                  $_SERVER['SERVER_PORT'] = 443;
              }
              
              NashBrydgesN 1 Reply Last reply Reply Quote 2
              • NashBrydgesN
                NashBrydges @Obsolesce
                last edited by

                @tim_g said in Wordpress Install - Page is trying to load unsafe script:

                Also, in your WP settings page, verify these are "https":

                0_1520979661167_e79ea302-916b-47a5-b20c-f883c6260a9d-image.png

                If I di this, unfortunately, I can't get to the blog or admin pages. I get an error stating too many redirects.

                1 Reply Last reply Reply Quote 0
                • ObsolesceO
                  Obsolesce
                  last edited by

                  I just looked again, and seen this as being blocked (but shows a green lock because FF is automatically blocking it):

                  0_1520980046984_d90e259e-658c-4446-92df-074ec981a52d-image.png

                  NashBrydgesN 1 Reply Last reply Reply Quote 0
                  • NashBrydgesN
                    NashBrydges @Obsolesce
                    last edited by

                    @tim_g said in Wordpress Install - Page is trying to load unsafe script:

                    Try adding this to the bottom of wp-config.php:

                    if($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
                    
                        $_SERVER['HTTPS'] = 'on';
                        $_SERVER['SERVER_PORT'] = 443;
                    }
                    

                    Added this but no change. Still getting the error. Looks like there are javascript being served via http instead of https.

                    1 Reply Last reply Reply Quote 0
                    • NashBrydgesN
                      NashBrydges @Obsolesce
                      last edited by

                      @tim_g said in Wordpress Install - Page is trying to load unsafe script:

                      I just looked again, and seen this as being blocked (but shows a green lock because FF is automatically blocking it):

                      0_1520980046984_d90e259e-658c-4446-92df-074ec981a52d-image.png

                      Yeah I changed the theme to sixteen to see if that changed anything but still getting mixed content warnings.

                      1 Reply Last reply Reply Quote 0
                      • NashBrydgesN
                        NashBrydges
                        last edited by

                        I think because my URLs on the Settings tab are still showing HTTP instead of HTTPS, the scripts are being served up via HTTP. But if I change the URLs to HTTPS, browser errors out with too may redirects.

                        1 Reply Last reply Reply Quote 0
                        • ObsolesceO
                          Obsolesce
                          last edited by

                          @nashbrydges said in Wordpress Install - Page is trying to load unsafe script:

                          @tim_g said in Wordpress Install - Page is trying to load unsafe script:

                          Try adding this to the bottom of wp-config.php:

                          if($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
                          
                              $_SERVER['HTTPS'] = 'on';
                              $_SERVER['SERVER_PORT'] = 443;
                          }
                          

                          Added this but no change. Still getting the error. Looks like there are javascript being served via http instead of https.

                          Did you add use this without the URLs set to https on the main settings page?

                          NashBrydgesN 1 Reply Last reply Reply Quote 0
                          • NashBrydgesN
                            NashBrydges @Obsolesce
                            last edited by

                            @tim_g I added the code lines to the bottom of wp-config.php as well as set both fields in Settings to https.

                            Doesn't work. Get a too many redirects error.

                            ObsolesceO 1 Reply Last reply Reply Quote 0
                            • ObsolesceO
                              Obsolesce @NashBrydges
                              last edited by

                              @nashbrydges said in Wordpress Install - Page is trying to load unsafe script:

                              @tim_g I added the code lines to the bottom of wp-config.php as well as set both fields in Settings to https.

                              Doesn't work. Get a too many redirects error.

                              Try the code without the urls changed

                              1 Reply Last reply Reply Quote 0
                              • JaredBuschJ
                                JaredBusch
                                last edited by

                                I used a plugin to fix ssl last time I I’d to do this.

                                No idea what the plugin was anymore.

                                ObsolesceO 1 Reply Last reply Reply Quote 0
                                • ObsolesceO
                                  Obsolesce @JaredBusch
                                  last edited by

                                  @jaredbusch said in Wordpress Install - Page is trying to load unsafe script:

                                  I used a plugin to fix ssl last time I I’d to do this.

                                  No idea what the plugin was anymore.

                                  This one?
                                  https://wordpress.org/plugins/ssl-insecure-content-fixer/

                                  JaredBuschJ 1 Reply Last reply Reply Quote 2
                                  • black3dynamiteB
                                    black3dynamite
                                    last edited by

                                    Force SSL Plugin
                                    https://wordpress.org/plugins/wp-force-ssl/

                                    Administrator over SSL
                                    https://codex.wordpress.org/Administration_Over_SSL

                                    JaredBuschJ 1 Reply Last reply Reply Quote 2
                                    • JaredBuschJ
                                      JaredBusch @Obsolesce
                                      last edited by

                                      @tim_g said in Wordpress Install - Page is trying to load unsafe script:

                                      @jaredbusch said in Wordpress Install - Page is trying to load unsafe script:

                                      I used a plugin to fix ssl last time I I’d to do this.

                                      No idea what the plugin was anymore.

                                      This one?
                                      https://wordpress.org/plugins/ssl-insecure-content-fixer/

                                      Either this one or

                                      1 Reply Last reply Reply Quote 0
                                      • JaredBuschJ
                                        JaredBusch @black3dynamite
                                        last edited by

                                        @black3dynamite said in Wordpress Install - Page is trying to load unsafe script:

                                        Force SSL Plugin
                                        https://wordpress.org/plugins/wp-force-ssl/

                                        This one

                                        1 Reply Last reply Reply Quote 0
                                        • JaredBuschJ
                                          JaredBusch
                                          last edited by

                                          I recall both names. Not sure which one worked.

                                          ObsolesceO 1 Reply Last reply Reply Quote 0
                                          • ObsolesceO
                                            Obsolesce @JaredBusch
                                            last edited by

                                            @jaredbusch said in Wordpress Install - Page is trying to load unsafe script:

                                            I recall both names. Not sure which one worked.

                                            To force SSL you don't need any add-on.
                                            I don't use one for my WordPress sites anywhere.

                                            But I can see needing one to properly handle forwarding from a reverse proxy.

                                            I have never used WP behind a reverse proxy so who knows.

                                            JaredBuschJ 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post