0

i want to rewrite and proxy EVERY url by this configure, this url not proxy: http://example.com/qwe/ewq and proxy work when use this: http://example.com . i think one solution is remove everything else from url. another one is just rewrite and not redirect. ... this is my nginx.conf:

server {
        listen       10.10.10.10:9999;
        server_name  _;

#       set $test_uri http://example.com ;
#       set $test_uri $scheme://$host$request_uri;

#       if ($test_uri != $scheme://$host$uri) {
#               rewrite ^ $scheme://$host$uri permanent;
#       }

#       if (-e $args) {
#               set $args /;
#       }

#       if ($request_uri != $test_uri) {
#               rewrite ^ http://example.com;
#       }

#       location /(.*) {
#               rewrite ^ http://example.com ;
#               }

#       rewrite ^http://(.*)/(.*)$ http://$1/ last;
#       rewrite ^(.*)/(.*) $scheme://$1/ permanent;

        location  / {
                #rewrite ^(.*)$ / permanent ;
                proxy_pass      http://192.168.1.10:8080/;
                }

 }
max
  • 1
  • please clarify what you want, and what actually happens, I don't understand. – Mohammad AbuShady Mar 10 '14 at 10:57
  • @MohammadAbuShady i want browse 10.10.10.10:9999/every/things?here , they go to location / . browse tmp1(now): url: 10.10.10.10:9999 -> proxy worked and go location / . browse tmp2(need): url: 10.10.10.10:9999/asd/ewq?qwe -> proxy not work... – max Mar 10 '14 at 16:53

0 Answers0