Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente |
serveurs:installation:web-srv:geonature-atlas-nginx [2021/04/16 13:49] – jpmilcent | serveurs:installation:web-srv:geonature-atlas-nginx [2023/12/05 14:51] (Version actuelle) – jpmilcent |
---|
* Tester la config et relancer Nginx si OK : ''nginx -t && nginx -s reload'' | * Tester la config et relancer Nginx si OK : ''nginx -t && nginx -s reload'' |
* Tester l'URL <nowiki>http://<alias>.<domaine-sinp></nowiki>/ qui doit afficher une erreur 502 si le serveur Gunicorn de l'Atlas n'est pas lancé. | * Tester l'URL <nowiki>http://<alias>.<domaine-sinp></nowiki>/ qui doit afficher une erreur 502 si le serveur Gunicorn de l'Atlas n'est pas lancé. |
* Vérifier les services supervisés par Supervisor : ''supervisorctl status'' | * Vérifier le service : ''systemctl status geonature-atlas.service'' |
* Démarrer le service Atlas : ''supervisorctl start atlas'' | * Démarrer le service Atlas : ''systemctl start geonature-atlas.service'' |
* Arrêter le service Atlas : ''supervisorctl stop atlas'' | * Arrêter le service Atlas : ''systemctl stop geonature-atlas.service'' |
* Installer un certificat SSL via Certbot (Letsencrypt) : ''<nowiki>certbot --nginx -d <alias>.<domaine-sinp> -d atlas.<domaine-sinp></nowiki>'' | * Installer un certificat SSL via Certbot (Letsencrypt) : ''<nowiki>certbot --nginx -d <alias>.<domaine-sinp> -d atlas.<domaine-sinp></nowiki>'' |
* Ex. SINP PACA : ''<nowiki> certbot --nginx -d nature.silene.eu -d atlas.silene.eu </nowiki>'' | * Ex. SINP PACA : ''<nowiki> certbot --nginx -d nature.silene.eu -d atlas.silene.eu </nowiki>'' |
} | } |
| |
ssl_certificate /etc/letsencrypt/live/nature.silene.eu/fullchain.pem; # managed by Certbot | ssl_certificate /etc/letsencrypt/live/<prefixe-non-atlas>.<domaine-sinp>/fullchain.pem; # managed by Certbot |
ssl_certificate_key /etc/letsencrypt/live/nature.silene.eu/privkey.pem; # managed by Certbot | ssl_certificate_key /etc/letsencrypt/live/<prefixe-non-atlas>.<domaine-sinp>/privkey.pem; # managed by Certbot |
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot | include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot |
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot | ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot |
listen [::]:443 ssl; | listen [::]:443 ssl; |
server_name atlas.<domaine-sinp>; | server_name atlas.<domaine-sinp>; |
return 302 https://nature.silene.eu$request_uri; | |
| ssl_certificate /etc/letsencrypt/live/<prefixe-non-atlas>.<domaine-sinp>/fullchain.pem; # managed by Certbot |
| ssl_certificate_key /etc/letsencrypt/live/<prefixe-non-atlas>.<domaine-sinp>/privkey.pem; # managed by Certbot |
| include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot |
| ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot |
| |
| return 302 https://<prefixe-non-atlas>.<domaine-sinp>$request_uri; |
} | } |
| |
listen [::]:80; | listen [::]:80; |
server_name <prefixe-non-atlas>.<domaine-sinp> atlas.<domaine-sinp>; | server_name <prefixe-non-atlas>.<domaine-sinp> atlas.<domaine-sinp>; |
return 302 https://nature.silene.eu$request_uri; | return 302 https://<prefixe-non-atlas>.<domaine-sinp>$request_uri; |
} | } |
</code> | </code> |
| * Penser à modifier le fichier //config.py// pour y indiquer la nouvelle URL en HTTPS : ''vi ~/www/atlas/atlas/configuration/config.py'' |
| |