0

I need to change the dsn in the request payload query string parameter with nginx.

I have to use another dsn to replace the old one if the dsn is matched with a specific dsn.

but it is not work, I have very few experience on nginx, therefore I need some help

user  nginx;

worker_processes  1;

events {
 worker_connections 1024;
}

http {
    map_hash_max_size 128;
    map_hash_bucket_size 128;
    include ./dns_map.conf;

    server {
        listen 80;
        server_name localhost;

        location / {
            if ($args ~* (.*)(dsn=https://123123@example.com/32)(.*)) {
                set $args dsn=http://456456@example99.com/77;
                rewrite ^(.*)$ $1;
            }
            proxy_pass http://example99/;
      
        }
    }
}
devlooper
  • 11
  • 1

0 Answers0