简体   繁体   中英

Nginx reverse proxy - Complete page render from proxy server

I am trying to render a page/url through proxy server, apparently not all my browser calls are pulling gif's/images/js etc from proxy server. Most of the calls are going through CDN/Source-ip etc. I would like to setup a proxy in such a way every network call go through proxy server.

Browser --> Proxy-server --> Destination ip (Vice versa)

 server_name proxy.example.com;
 location / {
          proxy_pass https://ziplinetest-ed.my.salesforce.com/;
          include /etc/nginx/proxy_params;
        }

Proxy Params:

proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;


client_max_body_size 100M;
client_body_buffer_size 1m;
proxy_intercept_errors on;
proxy_buffering on;
proxy_buffer_size 128k;
proxy_buffers 256 16k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_max_temp_file_size 0;
proxy_read_timeout 300;

When I hit https://proxy.example.com , it does take me to https://ziplinetest-ed.my.salesforce.com/ how ever most of the imgs/js scripts in browser coming from salesforce direct (instead through proxy). anyone have any insight how to achieve this ?

Once I login to SF through proxy.example.com, it redirects to "na50.lightning.force.com". No calls are going through proxy from there.

I am not sure whether its possible through reverse proxy server, guide me if I am choosing the wrong path.

try add:

proxy_pass https://ziplinetest-ed.my.salesforce.com;
proxy_redirect https://ziplinetest-ed.my.salesforce.com http://$server_name;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM