<div>@Jonathan: okok</div><div><br></div><div>Here is the known but can't be touched vhost file:</div><div><blockquote type="cite"><div>#################################################################</div><div>########### Vhost configuration of example.com</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 www.example.com;</div><div>location ~* ^.+.(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><span class="Apple-tab-span" style="white-space:pre"> </span>expires 24h;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>root /home/example/public_html;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>error_page 404 = @apache;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>access_log /usr/local/apache/domlogs/example.com;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>log_not_found off;<span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}<span class="Apple-tab-span" style="white-space:pre"> </span></div><div>location ~ /\.ht {</div><div> deny all;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div><br></div><div>location / {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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 http://www.example.com:8888 http://www.example.com;</div><div> proxy_redirect http://example.com:8888 http://example.com;</div><div> proxy_pass http://87.98.132.48:8888/;</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><span class="Apple-tab-span" style="white-space:pre"> </span>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 http://example.com:8888 http://example.com;</div><div> proxy_pass http://87.98.132.48:8888;</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/example.com";</div><div>}</div></blockquote></div>
<div><div>The only file I can modify is this one: /etc/cpnginx/custom/example.com</div><div><br></div><div>For forcing SSL, here is what I wrote in the custom file:</div><div><div></div><blockquote type="cite"><div>root@shadow [/etc/cpnginx/custom]# cat example.com </div>rewrite ^/(.*) https://$host/$1 permanent;</blockquote><div><br></div><div>I've also changed my signature ;)</div></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 à 17:42, 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 16:32, Adnan RIHAN <<a href="mailto:adnan@rihan.fr">adnan@rihan.fr</a>> wrote:</div><blockquote type="cite"><div><div>location / {</div><div>return 301 https://$host$request_uri;</div><div>}</div><div>location = /includes/api.php {</div><div>...</div><div>}</div><div><br></div><div>The problem is that I'm on a web hosting service which allow s customers to</div><div>edit an included config file.</div><div> So, "location /" is a duplicate :/</div><div><br></div><div>Isn't there a way to write "location [not matching] /includes/api.php {}" ?</div></div></blockquote><div><br></div><div>The method mentioned above *is* the canonical way to do that. It's in</div><div>the docs somewhere.</div><div><br></div><div>Anything else will be a hack of some kind, strongly influenced by your</div><div>specific nginx setup. You'll need to give more complete information</div><div>about the nuances of the shared hosting setup in order for someone to</div><div>work out if there's a way to achieve what you want to.</div><div><br></div><blockquote type="cite"><div><div>---</div><div>Cordialement, Adnan RIHAN.</div><div>Président-Fondateur de l'association (de loi 1901) Virtual-Info, hébergeur</div></div></blockquote><div><br></div><div>You have the wrong signature separator here. It's not "---"</div><div>(dash-dash-dash), it's "-- " (dash-dash-space).</div><div><br></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>