Hello,
I'm having a problem configuring subdomains. When I goto mydomain.com or www.mydomain.com everything works as it should by resolving to www.mydomain.com.
However, when I go to dev.mydomain.com it resolves to www.dev.mydomain.com.
Why is it doing this?
What I'm hoping to do is have www.mydomain.com point to a Drupal 6 installation, and dev.mydomain.com point to a Drupal 7 install.
Below is my conf setup...
Thanks!
Steve
---
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
http {
server {
listen 80;
server_name dev.mydomain.com;
root /var/drupal-7.15;
location / {
rewrite ^/(.*)$ /index.php?q=$1 permanent;
}
location ~* \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9000;
}
}
server {
listen 80;
listen 443 default ssl;
server_name mydomain.com www.mydomain.com;
ssl_protocols TLSv1 SSLv3;
ssl_certificate /home/certs/mydomain.com.crt;
ssl_certificate_key /home/certs/mydomain.key;
root /var/www;
client_max_body_size 8m;
if ($host !~* ^www\.) {
rewrite ^(.*)$ http://www.$host$1 permanent;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# This matters if you use drush
location = /backup {
deny all;
}
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}
location ~ \..*/.*\.php$ {
return 403;
}
location / {
try_files $uri @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9000;
}
location ~ ^/sites/.*/files/imagecache/ {
try_files $uri @rewrite;
}
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
include /etc/nginx/mime.types;
access_log /var/log/nginx/access.log;
sendfile on;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}