[resolu] Configuration d'un sous domaine sur nginx sur une instance Cloud
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

[resolu] Configuration d'un sous domaine sur nginx sur une instance Cloud

by
JeremieC7
Created on 2020-05-21 22:30:05 (edited on 2024-09-04 13:59:53) in Public Cloud OVHcloud

Bonjour, j'essaie de configurer un sous domaine sur nginx sur une instance cloud.

Avec l'adresse IP, j'accède bien au serveur, mais avec le sous-domaine j'ai une erreur : "Ce site est inaccessible... ERR_CONNECTION_REFUSED"

Voila la configuration :

server {
listen 80;
listen [::]:80;

root /var/www/html;

index index.html index.htm index.nginx-debian.html;

server_name blog.mydomain.com;

location / {
try_files $uri $uri/ =404;
}
}


Dans la zone DNS, j'ai enregistré blog.mydomain.com A xx.xx.xx.xx
Quand je ping blog.mydomain.com, j'ai bien l'IP de l'instance.

En vérifiant la configuration, tout semble ok :
> root@debian:/var/www/html# nginx -t
> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
> nginx: configuration file /etc/nginx/nginx.conf test is successful