Je viens d'installer Gogs sur un VPS à l'aide du tuto (https://gogs.io/docs/installation/install_from_source). J'ai un sous-domaine pour atteindre mon instance de gogs: git.mondomaine.com et cela fonctionne: http://git.mydomainname.com va à mon instance gogs avec un proxy inverse. Je voudrais que mes gogs soient protégés par SSL, donc je voudrais installer LetsEncrypt en utilisant le tuto suivant (https://certbot.eff.org/#debianstretch-nginx).Activer Letsencrypt dans Debian 9 avec Nginx pour Gogs
Je voudrais dire que je suis nouveau dans l'administration système et que je ne comprends pas nécessairement tout ce que j'ai fait pendant l'installation de Gogs. Je suis aussi nouveau à Nginx (plus habitué à Apache).
Voici le processus que je suivais:
$ sudo certbot certonly
Saving debug log to /var/log/letsencrypt/letsencrypt.log
How would you like to authenticate with the ACME CA?
-------------------------------------------------------------------------------
1: Place files in webroot directory (webroot)
2: Spin up a temporary webserver (standalone)
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Please enter in your domain name(s) (comma and/or space separated) (Enter 'c'
to cancel):git.mydomainname.com
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for git.mydomainname.com
Select the webroot for git.mydomainname.com:
-------------------------------------------------------------------------------
1: Enter a new webroot
-------------------------------------------------------------------------------
Press 1 [enter] to confirm the selection (press 'c' to cancel): /home/git/go/src/github.com/gogits/gogs
** Invalid input **
Press 1 [enter] to confirm the selection (press 'c' to cancel): 1
Input the webroot for git.mydomainname.com: (Enter 'c' to cancel):/home/git/go/src/github.com/gogits/gogs
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. git.mydomainname.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://git.mydomainname.com/.well-known/acme-challenge/N4rMGzoq1Bwyt9MP9fUlVY3_mDnJfRYpQkdvc7WrNJs: "<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>"
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: git.mydomainname.com
Type: unauthorized
Detail: Invalid response from
http://git.mydomainname.com/.well-known/acme-challenge/N4rMGzoq1Bwyt9MP9fUlVY3_mDnJfRYpQkdvc7WrNJs:
"<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A record(s) for that domain
contain(s) the right IP address.
Alors j'ai vérifié l'erreur, le DNS Un enregistrement est OK. J'ai aussi trouvé un autre tuto en français (https://www.grafikart.fr/formations/serveur-linux/nginx-ssl-letsencrypt) pour m'aider et j'ai remarqué que je devais mettre à jour ma configuration nginx pour le site, je l'ai fait, malgré un proxy inverse (peut-être que le problème est ici).
server {
listen 80;
server_name git.mydomainname.com
location ~ /\.well-known/acme-challenge {
allow all;
}
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location/{
proxy_pass http://localhost:port_number;
}
}
Merci pour votre aide.
Essayez '2: Lancez un serveur web temporaire (autonome) au lieu du serveur Web. – tkausl