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;
}
}