nginx tips

Posted on 2017-08-19 in Trucs et astuces • Tagged with nginx

CORS for multiple domains

location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
    if ( $http_origin ~* (https?://(.+\.)?(domain1|domain2|domain3)\.(?:me|co|com)$) ) {
        add_header "Access-Control-Allow-Origin" "$http_origin";
    }
}

Source: https://stackoverflow.com/a/27879729/3900519


CORS and HTTP authentication

Posted on 2015-06-27 in Auto-hébergement • Tagged with nginx, apache, webdav, owncloud

Before doing a request (POST, GET, PUT, …) on another domain with Javascript, web browsers will perform an OPTIONS request to verify that the request is likely to be accepted by the server. They mostly check for CORS headers.

This doesn't cause any troubles if …


Continue reading

Créer des pages d'erreurs personnalisées pour son blog pelican

Posted on 2014-06-29 in Auto-hébergement • Tagged with nginx, pelican

Rien de très compliqué. Par exemple, pour les erreurs 404, il suffit :

  • de créer une page 404.rst avec le status hidden :
:title: 404
:status: hidden

La page demandée n'existe pas. Vous pouvez revenir à `l'accueil <http://www.jujens.eu>`_.
  • d'ajouter une ligne dans sa configuration nginx :
error_page 404 …

Continue reading

Faire du https avec nginx

Posted on 2014-06-29 in Auto-hébergement • Tagged with nginx

Dans cet article, je ne vais pas …


Continue reading

Comment installer framanews sur son serveur avec PostgreSQL et nginx

Posted on 2014-06-14 in Auto-hébergement • Tagged with framanews, tt-rss, nginx, PostgreSQL

Framanews est un fork de ttrss, un lecteur de flux RSS en ligne. Il vous permet donc de consulter vos flux, de vous y abonner, … directement depuis un navigateur, où que vous soyez. Il dispose aussi d'une application Android. Il est évidement possible d'importer un fichier opml existant pour garder …


Continue reading