Désolé! Ta question est complètement passé sous mon radar.
Voici mes infos DNS:
Je suppose que tu es sur NGINX et non Apache?
De mon côté, j’ai un record dans mon nginx.conf pour forum.latranchee.com et un autre pour www.latranchee.com.
Ça ressemble à ça pour le site:
server {
listen 80; listen [::]:80;
listen 443 ssl http2;
server_name latranchee.com www.latranchee.com;
ssl_certificate /etc/letsencrypt/live/latranchee.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/latranchee.com/privkey.pem;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
client_max_body_size 50M;
add_header 'Access-Control-Allow-Origin' https://forum.latranchee.com;
root /home/latranchee/wordpress/wp_html;
location = /xmlrpc.php {
deny all;
}
location ~ /amp/$ {
rewrite ^(.*/)amp/$ $1 permanent;
}
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?q=$request_uri;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi.conf;
#fastcgi_pass 127.0.0.1:7777;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
Et ça pour le Discord:
server {
listen 80; listen [::]:80;
listen 443 ssl http2;
server_name forum.latranchee.com;
client_max_body_size 100m;
ssl_certificate /etc/letsencrypt/live/forum.latranchee.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/forum.latranchee.com/privkey.pem;
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
location / {
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Il faut faire attention parce qu’une erreur dans ce doc et ton serveur ne fonctionne plus.
Il faut reloader nginx à partir de la console à chaque fois qu’on modifie nginx.conf en utilisant service nginx reload
.
Donc dans ton cas, tu dois avoir 2 server block, dont 1 qui fait une redirection vers l’autre.
Ça ou va voir kk1 de @Programmation hahaha!