L
L
luckyjenro02022-04-02 09:01:03
Nginx
luckyjenro0, 2022-04-02 09:01:03

Why does VK not correctly display the site snippet?

I'm running a project on vue-cli via docker (nginx). Here is nginx.conf:

user  nginx;
worker_processes  1;
error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;
events {
  worker_connections  1024;
}
http {
  include       /etc/nginx/mime.types;
  default_type  application/octet-stream;
  log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                    '$status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"';
  access_log  /var/log/nginx/access.log  main;
  sendfile        on;
  keepalive_timeout  65;

map $status $expires {
        default off;
        301     1h;
}

gzip on;
gzip_disable "msie6";

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types
  application/atom+xml
  application/geo+json
  application/javascript
  application/x-javascript
  application/json
  application/ld+json
  application/manifest+json
  application/rdf+xml
  application/rss+xml
  application/xhtml+xml
  application/xml
  font/eot
  font/otf
  font/ttf
  image/svg+xml
  text/css
  text/javascript
  text/plain
  text/xml;

server {
      listen *:80;
        server_name blamegrief.ru www.blamegrief.ru;
        return 301 https:/blamegrief.ru;
    }
  server {
     location / {
      root   /app;
      index  index.html;
      try_files $uri $uri/ /index.html;
    }
    server_name blamegrief.ru www.blamegrief.ru;
 listen *:80;
    listen 443 ssl;
    server_name           blamegrief.ru;

    #ssl on;

    ssl_certificate /etc/letsencrypt/live/blamegrief.ru/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/blamegrief.ru/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
  }
}


The site itself perfectly redirects from http to https, opens, etc. In general, everything is fine!
BUT When I write my site in VK, I don’t get a snippet, like this: For
6247e62a2a260235861513.png

some reason, it pops up when I write with the protocol, those are the full path, although for other sites VK automatically determines https for some reason, and mine as http, CACHE VK clearpages cleared! And also on mobile phones nothing comes out at all!

Help plz, I'm running the site:
docker run --rm -v /etc/letsencrypt:/etc/letsencrypt -p 443:443 -p 80:80 my-app

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TheAndrey7, 2022-04-02
@luckyjenro0

The slash is missing and listen *:80; remove it from the second server so that it does not try to process http traffic.
return 301 https:/blamegrief.ru;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question