Rewrite non-ssl to ssl except for given location

Adnan RIHAN adnan at rihan.fr
Sun Apr 15 15:22:03 UTC 2012


Hi everybody,

I'm using an internal proxy for one of my websites (just a PHP script which does a curl request for a given script).

I've forced every non-ssl location to ssl with this:
> rewrite ^/(.*) https://$host/$1 permanent;


The thing is that my scripts doesn't need SSL as it's internal, so I want to force SSL except for a given location:
> location = /includes/api.php {
> }  
> rewrite ^/(.*) https://$host/$1 permanent;



Unfortunately, this isn't enough and queries to /includes/api.php?foo=bar still sends me a 301 redirect.
Am I missing something ?
Thanks for your help.
---
Cordialement, Adnan RIHAN.
Président-Fondateur de l'association (de loi 1901) Virtual-Info (http://www.virtual-info.info/), hébergeur Web et Serveurs de Jeux.
Consultant (http://rihan.fr/)-Technicien Supérieur en Informatique de Gestion.
Ambassadeur Qt (http://lyt.me/7E) (Projet Tag-PG (http://rihan.fr/fr/projets/tagpg)).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120415/fd4fd27d/attachment.html>


More information about the nginx mailing list