0

i'm getting trouble with my regex don't know what is wrong with it. it's returning a URi with orls/f instead of orls/f?p=4550. When i pass https://secure.toto02.com/orls/myservice/f?p=4550

my conf file is below

 location ~ "^/([a-zA-Z]+)/myservice/(.+)$" { error_log /var/log/nginx/error-server.log notice; rewrite_log on; #proxy_set_header Host $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; proxy_pass http://192.168.3.45:8080/orls/$2; proxy_redirect http://192.168.3.45:8080/orls/ https://secure.toto02.com/$1/myservice/ ; } 

Can anyone help?

1 Answer 1

2

Capturing the location will not encompass the query string. You have to manually include it via $is_args and $args variables like so:

proxy_pass http://192.168.3.45:8080/orls/$2$is_args$args; 

See @kolbyjack's (much better) answer: https://stackoverflow.com/questions/8130692/with-nginx-how-to-forward-query-parameters

1
  • Thanks a lot been on it for a while. Was a bout to go crazy on this one . Commented Apr 7, 2015 at 18:34

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.