Francis Daly
July 26, 2016 02:56PM
On Tue, Jul 26, 2016 at 03:46:19AM -0400, iivan wrote:

Hi there,

> ## nginx rule:
> rewrite ^/(.*)?$ /index.cfm?event=saveURL=$1$is_args$args last;
>
> ## this URL:
> http://www.mywebsite.com/http://www.anotherwebsite.com/index.php?lvl=cmspage&pageid=14&id_article=52
>
>
> ## Return only:
> http://www.anotherwebsite.com/index.php?lvl=cmspage

That config will get nginx to do an internal rewrite to the location
/index.cfm.

What does your /index.cfm do?

That is: nginx does not return
http://www.anotherwebsite.com/index.php?lvl=cmspage, index.cfm does.

You *could* try to do the proper encoding/escaping in the rewrite,
but I am not aware of a simple nginx function that will help you.


I *suspect* that if you replace

rewrite ^/(.*)?$ /index.cfm?event=saveURL=$1$is_args$args last;

with

rewrite ^/(.*)?$ /index.cfm?event=saveURL=$1$is_args$args? last;

(extra ? at the end), or, equivalently, with

rewrite ^/(.*)?$ /index.cfm?event=saveURL=$1 last;

(no ? at the end, and remove $is_args$args), then you will be able to
tell your /index.cfm to use all of the QUERY_STRING after "event=saveURL="
as the bulk of the thing that should be returned, and it might all do
what you want.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Full URL parameter in nginx

iivan June 23, 2016 07:10AM

Re: Full URL parameter in nginx

nanaya June 23, 2016 07:24AM

Re: Full URL parameter in nginx

iivan June 23, 2016 10:37AM

Re: Full URL parameter in nginx

iivan June 24, 2016 04:26PM

Re: Full URL parameter in nginx

iivan July 25, 2016 01:15PM

Re: Full URL parameter in nginx

Francis Daly July 25, 2016 07:36PM

Re: Full URL parameter in nginx

iivan July 26, 2016 03:46AM

Re: Full URL parameter in nginx

Francis Daly July 26, 2016 02:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 145
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready