简体   繁体   中英

Nginx rewrite POST as GET, and redirect

Is it possible for a POST request to http://me.com

to be converted to a GET request such as http://me.com/api.php?some_static_param=yippee;<rest of post data as get request> using Nginx?

You could do this using a scripting language such as Lua or Perl but as these are relatively obscure and Lua need to be installed and a module compiled, why not just do it using the scripting language you already have in place and probably quite familiar with ... PHP?.

Setup your index file to access the $_POST array if it exists, build the request string and send a location header to redirect the user.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM