<div style="font-family: Helvetica; font-size: 13px; ">By the way,<div>rewrite ^/(?!includes/api\.php) https://$http_host$uri?$args;</div><div><br></div><div>Is working weeeell, thank you :)</div></div>
                <div><div><br></div><div>-- <br>Cordialement, Adnan RIHAN.<br>
<u>Président</u>-<u>Fondateur</u> de l'association (de loi 1901) <a href="http://www.virtual-info.info/" target="_blank"><b>Virtual-Info</b></a>, <i>hébergeur Web et Serveurs de Jeux</i>.<br>
<a href="http://rihan.fr/" target="_blank"><u>Consultant</u></a>-<u>Technicien Supérieur</u> en <i>Informatique de Gestion</i>.<br><u>Ambassadeur</u> <a href="http://lyt.me/7E" target="_blank"><b>Qt</b></a> (Projet <a href="http://rihan.fr/fr/projets/tagpg" target="_blank"><b>Tag-PG</b></a>).<u><br></u></div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">Le dimanche 15 avril 2012 à 18:50, Jonathan Matthews a écrit :</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div>On 15 April 2012 17:16, Adnan RIHAN <<a href="mailto:adnan@rihan.fr">adnan@rihan.fr</a>> wrote:</div><blockquote type="cite"><div><div>@Jonathan: okok</div><div><br></div><div>Here is the known but can't be touched vhost file:</div><div><br></div><div>#################################################################</div><div>########### Vhost configuration of  <a href="http://example.com">example.com</a></div><div>#################################################################</div><div>server {</div><div>access_log off;</div><div>error_log  logs/vhost-error_log warn;</div><div>listen    80;</div><div>server_name  example.com <a href="http://www.example.com">www.example.com</a>;</div><div>location ~*</div><div>^.+.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)$</div><div>{</div><div>expires 24h;</div><div>root /home/example/public_html;</div><div>error_page  404 = @apache;</div><div>access_log /usr/local/apache/domlogs/<a href="http://example.com">example.com</a>;</div><div>log_not_found  off;</div><div>}</div><div>location ~ /\.ht {</div><div>          deny all;</div><div>}</div><div><br></div><div>location / {</div><div>log_not_found  off;</div><div><br></div><div>  client_max_body_size    2000m;</div><div>  client_body_buffer_size 512k;</div><div>  proxy_send_timeout   90;</div><div>  proxy_read_timeout   90;</div><div>  proxy_buffer_size    32k;</div><div>  proxy_buffers     16 32k;</div><div>  proxy_busy_buffers_size 64k;</div><div>  proxy_temp_file_write_size 64k;</div><div>  proxy_connect_timeout 30s;</div><div><br></div><div>        proxy_redirect  <a href="http://www.example.com:8888">http://www.example.com:8888</a></div><div><a href="http://www.example.com">http://www.example.com</a>;</div><div>        proxy_redirect  <a href="http://example.com:8888">http://example.com:8888</a>   <a href="http://example.com">http://example.com</a>;</div><div>        proxy_pass   <a href="http://87.98.132.48:8888">http://87.98.132.48:8888</a>/;</div><div>        proxy_set_header   Host   $host;</div><div>        proxy_set_header   X-Real-IP  $remote_addr;</div><div>        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;</div><div>        }</div><div>location @apache {</div><div>internal;</div><div><br></div><div>  client_max_body_size    2000m;</div><div>  client_body_buffer_size 512k;</div><div>  proxy_send_timeout   90;</div><div>  proxy_read_timeout   90;</div><div>  proxy_buffer_size    32k;</div><div>  proxy_buffers     16 32k;</div><div>  proxy_busy_buffers_size 64k;</div><div>  proxy_temp_file_write_size 64k;</div><div>  proxy_connect_timeout 30s;</div><div><br></div><div>        proxy_redirect  <a href="http://example.com:8888">http://example.com:8888</a>   <a href="http://example.com">http://example.com</a>;</div><div>        proxy_pass   <a href="http://87.98.132.48:8888">http://87.98.132.48:8888</a>;</div><div>        proxy_set_header   Host   $host;</div><div>        proxy_set_header   X-Real-IP  $remote_addr;</div><div>        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;</div><div>        }</div><div>include "/etc/cpnginx/custom/<a href="http://example.com">example.com</a>";</div><div>}</div><div><br></div><div>The only file I can modify is this one: /etc/cpnginx/custom/<a href="http://example.com">example.com</a></div></div></blockquote><div><br></div><div>I don't understand how this could ever work. The only entry point</div><div>you've shown to the @apache location is if the URI's path ends in</div><div>".(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|iso|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|ogv|ogg|flv|swf|mpeg|mpg|mpeg4|mp4|avi|wmv|js|css)"</div><div><br></div><div>That doesn't include ".php", so I don't see how control of</div><div>"/includes/api.php" ever hits the file you can amend.</div><div><br></div><div>Assuming there's something I'm missing here and .php does in fact</div><div>reach that file, here's how you might achieve what you want. It uses</div><div>PCRE negative lookaheads, which I don't know definitely work inside</div><div>nginx.</div><div><br></div><div>    rewrite ^/(?!includes/api\.php) https://$http_host$uri?$args;</div><div><br></div><div>For what it's worth, I personally wouldn't use a host that enforced</div><div>these restrictions on my configuration, like OVH appear to be doing</div><div>here. It's *extremely* unpleasant.</div><div><br></div><div>HTH,</div><div>Jonathan</div><div>-- </div><div>Jonathan Matthews</div><div>Oxford, London, UK</div><div><a href="http://www.jpluscplusm.com/contact.html">http://www.jpluscplusm.com/contact.html</a></div><div><br></div><div>_______________________________________________</div><div>nginx mailing list</div><div><a href="mailto:nginx@nginx.org">nginx@nginx.org</a></div><div><a href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>