Bonjour,
J'essaye d'héberger plusieurs NDD et sites sur un serveur avec Nginx, et contrairement à d'habitude je n'arrive pas. Quoique je fasse les deux sites dirigent vers le deuxième.
Configuration du premier (fonctionnel quand seul activé) :
server {
#listen 80;
server_name site1.com;
index index.html index.php;
charset utf-8;
error_page 500 502 503 504 /50x.html;
location = /50x.html { root /usr/share/nginx/html; }
location = /var/www/site/favicon.ico {
access_log off;
return 204;
}
## Début de config wordpress ##
location ^~ / {
root /var/www/site1/;
try_files $uri $uri/ /index.php?q=$uri&$args;
include /etc/nginx/conf.d/php;
include /etc/nginx/conf.d/cache;
satisfy any;
allow all;
}
## fin de config wordpress ##
}
Et le deuxième, qui redirige vers le premier quand je fais rien (surement car c'est l'IP du serveur), et qui quand je l'active le premier redirige vers lui :
server {
#listen 80;
server_name beta.site2.com;
index index.html index.php;
charset utf-8;
error_page 500 502 503 504 /50x.html;
location = /50x.html { root /usr/share/nginx/html; }
location = /var/www/site/favicon.ico {
access_log off;
return 204;
}
## Début de config wordpress ##
location ^~ / {
root /var/www/site2/;
try_files $uri $uri/ /index.php?q=$uri&$args;
include /etc/nginx/conf.d/php;
include /etc/nginx/conf.d/cache;
satisfy any;
allow all;
}
## fin de config wordpress ##
}
Je suis totalement bloqué, je ne comprends pas j'ai tenté plein de configuration.