2

I have a rails application deployed on an amazon ec2 ubuntu instance, configured with nginx which is working fine. The problem is when I try and post the url of the site on facebook without https either http://example.com or www.example.com it posts the banner of the site with the text "welcome to nginx" and not the description that has been set in the meta tags. Upon clicking the link redirects to the site as it should but I want to get rid of the "Welcome to nginx" text and want to see the description that is set in the meta tag.

However posting the URL with https posts the correct information as provided in the meta tags.

On the other hand entering the URL of the site in the browser with or without https also redirects to the site as it should. Here are the nginx configs for my app:

server {
  listen   443 ssl;
  ssl         on;
  server_name myipaddress;
  passenger_enabled on;
  rails_app_spawner_idle_time 0;
  passenger_min_instances 1;
 root /home/ubuntu/example/public;
 ssl_certificate (.pem file path);
 ssl_certificate_key (.key file path);
 }
 server {
       listen         80;
       server_name    myip;
       return         301 https://$server_name$request_uri;
  }

server{
  listen 80;
  server_name example.com;
  return 301 https://www.$server_name$request_uri;
   }

server{
  listen 80;
  server_name www.example.com;
  return 301 https://$server_name$request_uri;
}

I did hours of googling and came across only this link that looks pretty similar to my problem click here after which I disabled IPV6 on my server as suggested as one of the two solutions in the link but still the problem remains as it was.

Is it something related to the SSL or nginx configurations? Any help would be hugely appreciated. I have spent hours and hours searching for a solution but so far haven't been able to find one.

Zaeem Asif
  • 33
  • 5

1 Answers1

0

Found the solution, it actually was an issue with the metatags and not the configurations of the server nor SSL. Made some changes in the and tags as suggested in this link.

Zaeem Asif
  • 33
  • 5