LinkedIn sharing has not worked for me.
So I checked a URL from LinkedIn’s Post Inspector.
A 400 error has occurred.
I checked the server error log again.
[error] 4993#4993: *22595 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 1.1.1.1, server: example.com, request: "GET / HTTP/1.1", upstream: "uwsgi://unix://www/webservice.sock:", host: "example.com", referrer: "url"
This snippet is for future me. Most answers for this problem you'll see are related to PHP. This issue is related to the buffer size in the uWSGI. Probably your requests have a long query parameters and cookies.
First, I added the following code to nginx.conf:
reset_timedout_connection on;
keepalive_requests 1000;
send_timeout 30;
server_names_hash_max_size 2048;
#access_log /var/log/nginx/access.log;
access_log off;
log_not_found off;
but it still has not worked.
One setting that occasionally needs to be adjusted is UWSGI_BUFFER_SIZE. The default value is 4096. If you plan to receive relatively big requests, you'll need to change this parameter value. You can tune it up to 65535.
I do it in my application config uwsgi ini file. ( basically ini file is in /etc/uwsgi/ )
buffer-size=32768
* If you want to show an OG image, then you have to resize the image to 1200 px, etc.
My image was 4032x3024, and it didn't show up.
Now everything works fine. :)
Ref.
https://yoast.com/help/linkedin-sharing-not-working/