Join the community today
Register Now

Nginx SSL need help. my website is taking fb preview from another site on the server

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by idanisur, Jul 13, 2019 at 3:31 PM.

  1. idanisur

    idanisur New Member

    8
    1
    3
    Apr 15, 2019
    Ratings:
    +1
    Local Time:
    7:18 PM
    i was 3 website with www. at ee server. I have moved them to my centmin server . everything working but if i type my website url in facebook without https:// the preview is coming from another website on this server . (website URL islamqabd .com but facebook preview is coming from inmarking .com ) .
    screenshot url : https://photos.app.goo.gl/fVucRnMBracYNGE18
     
  2. eva2000

    eva2000 Administrator Staff Member

    40,625
    9,017
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,884
    Local Time:
    11:18 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Please provide/fill in any relevant information that applies to you:
    • CentOS Version: i.e. CentOS 6 32bit or 64bit / CentOS 7 64bit ?
    • Centmin Mod Version Installed: i.e. 123.08stable or 123.09beta01
    • Nginx Version Installed: i.e. 1.15.3
    • PHP Version Installed: i.e. 5.6.37, 7.0.31, 7.1.21, 7.2.9
    • MariaDB MySQL Version Installed: i.e. 10.0.x or 10.1.xx or 10.2.xx
    • When was last time updated Centmin Mod code base ? : i.e. run centmin.sh menu option 23 submenu option 2 or cmupdate command
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:
      Code (Text):
      cat /etc/centminmod/custom_config.inc
      

      Post output in CODE tags.
    also for each 3 domains, please post the output of the below curl commands wrapped in CODE tags (outlined at How to use forum BBCODE code tags)

    what is output of these commands in ssh
    Code (Text):
    curl -I https://domain.com
    

    Code (Text):
    curl -I https://www.domain.com
    

    Code (Text):
    curl -I http://domain.com
    

    Code (Text):
    curl -I http://www.domain.com
    

    wrap output in CODE tags
     
  3. idanisur

    idanisur New Member

    8
    1
    3
    Apr 15, 2019
    Ratings:
    +1
    Local Time:
    7:18 PM
     
    style="display:inline-block;min-width:400px;max-width:970px;width:95%;height:90px" data-ad-client="ca-pub-6669518204467592" data-ad-slot="4024536743" data-ad-format="auto">
  4. eva2000

    eva2000 Administrator Staff Member

    40,625
    9,017
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,884
    Local Time:
    11:18 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    are you using cloudflare's wordpress plugin ?

    seems they're all directing to the right site in curl inspecting the curl output's target destination listed in Location field.

    though the non-www redirects for https are redirecting to non-www https and www non-https redirecting to www https

    how was each site created ? via centmin.sh menu option 2, 22 or nv command ?

    What's output for these commands changing /home/nginx/domains/domain.com/public/ to the path to where you installed wordpress i.e. if domain.com/blog then it would be /home/nginx/domains/domain.com/public/blog
    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp option get siteurl --allow-root
    wp option get home --allow-root
    

    If siteurl and home values are coming up with non-www and you want www being the main destination you can change them in your wordpress generation url settings or more thoroughly via wp-cli command line
    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp search-replace 'https://example.com' 'https://www.example.com' --skip-columns=guid
    

    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp option update home 'https://www.example.com'
    wp option update siteurl 'https://www.example.com'
    


    And same in reverse, if siteurl and home values are coming up with www and you want non-www being the main destination you can change them in your wordpress generation url settings or more thoroughly via wp-cli command line
    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp search-replace 'https://www.example.com' 'https://example.com' --skip-columns=guid
    


    Code (Text):
    cd /home/nginx/domains/domain.com/public/
    wp option update home 'https://example.com'
    wp option update siteurl 'https://example.com'
    


    In cloudflare don't set always use HTTPS, if you have the 301/302 redirects already in your nginx domain vhost config files at /usr/local/nginx/conf/conf.d/yourdomain.com.ssl.conf - it's one or the other, so if you want cloudflare always use HTTPS set, then disable the 301/302 non-https to https redirects at nginx domain vhost config level.
     
  5. idanisur

    idanisur New Member

    8
    1
    3
    Apr 15, 2019
    Ratings:
    +1
    Local Time:
    7:18 PM