Bonjour,
J'ai suivis une partie de ce tutoriel pour installer mon serveur web (nginx) et configurer mon premier nom de domaine :
http://wiki.rezo-zero.com/index.php/Installer_un_serveur_web_sous_Debian#Serveur_public
J'ai donc dans /etc/nginx/sites-available/mydomain.org.conf :
server {
listen 80;
server_name mydomain.org;
return 301 $scheme://www.mydomain.org$request_uri;
}
server {
listen 80;
root /var/www/vhosts/www.mydomain.org/htdocs;
index index.html index.htm index.php;
# Make site accessible from http://www.mydomain.org/
server_name www.mydomain.org;
# Specify a character set
charset utf-8;
access_log /var/www/vhosts/www.mydomain.org/log/access.nginx.log;
error_log /var/www/vhosts/www.mydomain.org/log/error.nginx.log;
location / {
try_files $uri $uri/ /index.php?$args;
}
# Don't log robots.txt or favicon.ico files
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { allow all; access_log off; log_not_found off; }
# pass the PHP scripts to FastCGI server
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm-mydomain.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_PORT 80;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
Mais lorsque j'accède à « mydomain.org » depuis mon navigateur, il redirige la page vers «
www.mydomain.org » mais j'ai un message « La page n'est pas redirigée correctement ».
De plus, j'aimerai savoir comment faire pour configurer un sous-domaine « forum.mydomain.org », faut-il que je recrée un fichier de conf nginx ? Ou une nouvelle règle « server { } » ?
Car quoi que je mette avant mydomaine.org, ça me redirige sur mydomain.org en enlevant le sous-domaine.
Merci de votre aide