I have a webserver that hosts 15 vhosts, all are listening on port 80. I'm in the process of adding another vhost, except this one is listening on both 80 and 443. However, when I add the second server directive for the SSL port and restart the nginx server, it doesn't load the correct vhost. It appears to load the last vhost in ascii order from the /etc/nginx/sites-available/*
If I remove the server directive referencing port 443, the correct vhost website is restored. I cannot figure out why this is happening. Any help would be greatly appreciated, thanks.
vhost-config
[code]
server {
listen 443 ssl default_server;
server_name *.website.com;
root /var/www/vhost/www.website.com/public_html/httpdocs/;
index index.php;
ssl_certificate /etc/nginx/ssl/www.website.com/website.com.crt;
ssl_certificate_key /etc/nginx/ssl/www.website.com/website.com.key;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_hide_header X-Powered-By;
}
}
[/code]