Aleksandar Lazic
May 22, 2018 08:06AM
Hi Pedro

On 18/05/2018 16:02, pedrobrigatto wrote:
> Hi guys,
>
> The base name of a web application has changed and now I need to implement a
> redirection of POST requests so that, whenever clients already using the old
> base path are not affected by this modification. So, let's say the old path
> to a web service is https://ip-address/old-name/rest/mymethod and now it is
> going to be https://ip-address/new-name/rest/mymethod
>
> I tried both return 307 and rewrite rules but nothing worked until now.
> Can you please give me a hand on this?

This will not work without proper post handling.

https://duckduckgo.com/?q=post+redirect+data

Why not using a proxy_pass with new-name?
https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass

Untested

location /old-name/rest/mymethod {
proxy_pass https://ip-address/new-name/rest/mymethod;
}

> Thank you very much in advance!
>
> Best regards,
> Pedro

Best regards
Aleks

> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,279868,279868#msg-279868
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

POST redirection with NGINX

pedrobrigatto May 18, 2018 04:02PM

Re: POST redirection with NGINX

Aleksandar Lazic May 22, 2018 08:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 201
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready