NGinX config for specific referer

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NGinX config for specific referer

David Wright-9
Hi all,

I wonder if anyone could help, please…

Active4D v6.3r1, 4D Server v12, NGinX 1.6.1

I want to automatically log in visitors who are refered from a particular URL.

So, if the referer is “www.xyz.com/privatepage” I want to forward the request to a special Active4D page which will automatically log them in to our site, then redirect them onwards.

Configuring NGinX is not my strong point, but I expect I need some adaptation of the code I already have for all standard HTML pages:

location ~ \.html$ {
rewrite /(.*)\.html /infant/$1.a4d break;
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_pass http://active_4d_server;
break;
}

Thank you!

David Wright
_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/
Reply | Threaded
Open this post in threaded view
|

Re: NGinX config for specific referer

Aparajita Fishman
I know nothing about nginx, but I can say that perhaps it isn’t such a good idea to rely on the referer for authentication. It’s a wide open security hole that is easily abused.

All the best,

  - Aparajita

> On Nov 16, 2017, at 8:21 AM, David Wright <[hidden email]> wrote:
>
> Hi all,
>
> I wonder if anyone could help, please…
>
> Active4D v6.3r1, 4D Server v12, NGinX 1.6.1
>
> I want to automatically log in visitors who are refered from a particular URL.
>
> So, if the referer is “www.xyz.com/privatepage” I want to forward the request to a special Active4D page which will automatically log them in to our site, then redirect them onwards.
>
> Configuring NGinX is not my strong point, but I expect I need some adaptation of the code I already have for all standard HTML pages:
>
> location ~ \.html$ {
> rewrite /(.*)\.html /infant/$1.a4d break;
> 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_pass http://active_4d_server;
> break;
> }
>
> Thank you!
>
> David Wright
> _______________________________________________
> Active4D-dev mailing list
> [hidden email]
> http://list.aparajitaworld.com/listinfo/active4d-dev
> Archives: http://active4d-nabble.aparajitaworld.com/

_______________________________________________
Active4D-dev mailing list
[hidden email]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/