[Résolu]Relancer nginx suite à une erreur?

Bonsoir,
J’ai installé yunohost dans sa dernière version, j’ai l’accès ssh en root. J’étais entrain de modifier mon fichier de configuration d’une application webapp:
/etc/nginx/conf.d/nom-de-domaine.d/webpapp_*.conf
Après l’avoir sauvegardé je souhaitais relancer nginx. J’ai successivement utilisé les commandes suivante car la modification de mon fichier webpapp_*.conf n’était pas pris en compte:
/etc/init.d/nginx restart

/etc/init.d/nginx reload

service nginx restart

service nginx reload

systemctl restart nginx

Le souci c’est que l’ensemble de mes sites sont inaccessibles.
Que faut-il faire pour relancer nginx correctement? En vous remerciant pour votre aide.

Bonsoir,

Pour démarrer, arrêter, relancer un service sur Yunohost :

sudo yunohost service -h

Amicalement,
Gaëtan.

Bonsoir,
Merci pour votre aide.
Après avoir tapé cela:

yunohost service restart nginx

J’obtiens cela:
root@wendling:/home/admin# yunohost service restart nginx
Job for nginx.service failed because the control process exited with error code.
See “systemctl status nginx.service” and “journalctl -xe” for details.
Warning: Could not execute the command ‘systemctl restart nginx’
Error: Could not restart the service ‘nginx’

Recent service logs:-- Logs begin at Sun 2021-02-07 19:41:53 CET, end at Mon 2021-02-08 21:55:02 CET. –
Feb 08 20:37:00 systemd[1]: Stopping A high performance web server and a reverse proxy server…
Feb 08 20:37:00 systemd[1]: nginx.service: Succeeded.
Feb 08 20:37:00 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 08 20:37:00 systemd[1]: Starting A high performance web server and a reverse proxy server…
Feb 08 20:37:00 nginx[25996]: nginx: [emerg] location “/api” is outside location “/site3/” in /etc/nginx/conf.d/wendling.xyz.d/my_webapp__3.conf:46
Feb 08 20:37:00 nginx[25996]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 08 20:37:00 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Feb 08 20:37:00 systemd[1]: nginx.service: Failed with result ‘exit-code’.
Feb 08 20:37:00 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 08 20:37:38 systemd[1]: nginx.service: Unit cannot be reloaded because it is inactive.
Feb 08 21:53:56 systemd[1]: Starting A high performance web server and a reverse proxy server…
Feb 08 21:53:56 nginx[26755]: nginx: [emerg] location “/api” is outside location “/site3/” in /etc/nginx/conf.d/wendling.xyz.d/my_webapp__3.conf:46
Feb 08 21:53:56 nginx[26755]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 08 21:53:56 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Feb 08 21:53:56 systemd[1]: nginx.service: Failed with result ‘exit-code’.
Feb 08 21:53:56 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 08 21:55:02 systemd[1]: Starting A high performance web server and a reverse proxy server…
Feb 08 21:55:02 nginx[26771]: nginx: [emerg] location “/api” is outside location “/site3/” in /etc/nginx/conf.d/wendling.xyz.d/my_webapp__3.conf:46
Feb 08 21:55:02 nginx[26771]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 08 21:55:02 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Feb 08 21:55:02 systemd[1]: nginx.service: Failed with result ‘exit-code’.
Feb 08 21:55:02 systemd[1]: Failed to start A high performance web server and a reverse proxy server.

Je vais remettre en place mon ancien

my_webapp__3.conf

Que représente le 46? La 46eme ligne? Un code erreur?
Merci pour vos retours

Salut,

Que représente le 46? La 46eme ligne? Un code erreur?

Cela t’indique qu’il y a une erreur à la ligne 46 du fichier de conf, ici my_webapp__3.conf

Merci pour cette réponse,
Je viens de remettre l’ancien fichier en place et tout refonctionne, ouf! Je vais me pencher sur mon fichier modifié.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.