Nignx reverse proxy, POST request returned 403 error

using Nginx reverse proxy Pinterest, the site can be opened normally, but there is an error in the POST request.

queried a lot of materials, but still couldn"t find the reason for the error. Please take a look at it for me. The content of the Nginx configuration file is as follows:

server {
    listen 80;
    listen 443;
    listen [::]:80;
    listen [::]:443;
    
    server_name pin.domain.com;
    
    error_log /var/log/nginx/pinterest.log info;
    
    ssl_certificate     /opt/certs/pin.domain.com/fullchain.pem;
    ssl_certificate_key /opt/certs/pin.domain.com/privkey.pem;
    
    location / {
        proxy_pass https://www.pinterest.com;
        proxy_set_header Host $proxy_host;
        proxy_set_header Accept-Encoding "";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_cookie_domain .pinterest.com .domain.com;

        sub_filter "i.pinimg.com" "ipinimg.domain.com";
        sub_filter "s.pinimg.com" "spinimg.domain.com";
        sub_filter_types *;
        sub_filter_once off;
    }
}

server {
    listen 80;
    listen 443;
    listen [::]:80;
    listen [::]:443;
    
    server_name ipinimg.domain.com;
    
    error_log /var/log/nginx/ipinimg.log info;
    
    ssl_certificate     /opt/certs/ipinimg.domain.com/fullchain.pem;
    ssl_certificate_key /opt/certs/ipinimg.domain.com/privkey.pem;
    
    location / {
        proxy_pass https://i.pinimg.com;
        proxy_set_header Host $proxy_host;
        proxy_set_header Accept-Encoding "";
        

        sub_filter "i.pinimg.com" "ipinimg.domain.com";
        sub_filter "s.pinimg.com" "spinimg.domain.com";
        sub_filter_types *;
        sub_filter_once off;
    }
}

server {
    listen 80;
    listen 443;
    listen [::]:80;
    listen [::]:443;
    
    server_name spinimg.domain.com;
    
    error_log /var/log/nginx/spinimg.log info;
    
    ssl_certificate     /opt/certs/spinimg.domain.com/fullchain.pem;
    ssl_certificate_key /opt/certs/spinimg.domain.com/privkey.pem;
    
    location / {
        proxy_pass https://s.pinimg.com;
        proxy_set_header Host s.pinimg.com;
        proxy_set_header Accept-Encoding "";

        
        
        sub_filter "i.pinimg.com" "ipinimg.domain.com";
        sub_filter "s.pinimg.com" "spinimg.domain.com";
        sub_filter_types *;
        sub_filter_once off;
    }
}
Mar.31,2021

I have the same problem. Wait for the answer


consider whether there is a cross-domain problem

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d32e-2c389.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d32e-2c389.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?