0

I have following location with rewrite:

location ~ ^/payment/gateway/v2/order/complete/(.*)$ {
    proxy_pass http://api.test.com:8080/payment/gateway/v2/order/complete?order_id=$1;
}

then I tried this:

 location /payment/gateway/v2/order/complete {
    rewrite ^/payment/gateway/v2/order/complete/(.+) /payment/gateway/v2/order/complete?order_id=$1 break;
    proxy_pass http://api.test.com:8080
}

then this:

 location /payment/gateway/v2/order/complete/ {
    rewrite ^/payment/gateway/v2/order/complete/$ /payment/gateway/v2/order/complete?order_id=$1 last;
    proxy_pass http://api.test.com:8080
}

then this:

location /payment/gateway/v2/order/complete {
    rewrite ^/payment/gateway/v2/order/complete/([^/]+)$ /payment/gateway/v2/order/complete?order_id=$1 last;
    proxy_pass http://api.test.com:8080;
}

all of them not works.

Nginx version 1.13.8

Thanks in advance

EDIT All of code above works fine, I found my mistake. I copied one of configuration file to conf.d folder for backup but forgot rename it extension. I removed it and all works fine. Thank you for all for help!

SBotirov
  • 13,872
  • 7
  • 59
  • 81

1 Answers1

1
nginx -V 2>&1 | tr -- - '\n' | grep  _module

This is how to ckeck installed modules. I have the same issue and looks like I don't have the module installed/enabled...

Hyppo Drums
  • 111
  • 1