Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Cannot pass well to external site + cannot manipulate responses

$
0
0
Hello, i'm new at nginx and i'm trying to set up the proxy to do the following tasks:
1. all requests will be passed into an external site
2. change specific strings (later i want to do more complex logic).

i'm trying to forward all traffic to an external domain for example:

my configuration is as follow:

server {
listen 80;
location / {
proxy_pass https://external.com;

proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_request_headers on;

sub_filter_once off;
sub_filter_types *;
sub_filter "Welcome" "Test";
}

I'm able to be redirected to the external domain and surf, but there are few problems:
1. some sites for example handle csrf attacks, any anything else - i'm aware that i'm going through a proxy but i want to retain all the original requests and i'm not sure what gets lost (for example trello blocks me for csrf detection).
2. the rewrite just doesn't work, nothing in the response body is changed.

Assistance will be appreciated.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>