2011-11-30 4 views
1

nginx 및 일부 wordpress 사이트로 하위 도메인을 설정하는 데 문제가 있습니다.nginx의 하위 도메인에있는 wordpress 사이트

내 www.jackalopegames.com 도메인이 작동하지만 dev.jackalopegames.com을 설정하고 싶습니다.

여기에 나의 위치 기반 폴더에 config 파일입니다 :

server 
{ 
    listen 80; 
    server_name jackalopegames.com www.jackalopegames.com; 

    include /etc/nginx/fastcgi_php; 

    root /var/sitefolder; 

    index index.php; 

} 

server { 
    listen 80; 
    server_name dev.jackalopegames.com; 

    include /etc/nginx/fastcgi_php; 

    root /var/devfolder; 

    index index.php; 

} 

첫 번째 server_name jackalopegames.com 작품, 두 번째는 포함하지 않습니다. 나는 한 무리를 둘러 보았고 이것이 왜 작동하지 않는지에 관해서는 분실했다. 어떤 조언을 부탁드립니다!

업데이트 : 영향을 미치지 않고 내 하위 도메인 server {...}에 다음 추가 한

:

당신은 이미 확인하지 않을 수있다 것들의 무리가 있습니다
location/{ 
      root /var/dev; 
      index index.php; 
      rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last; 
      if (!-e $request_filename) { 
       rewrite ^.+/?(/wp-.*) $1 last; 
       rewrite ^.+/?(/.*\.php)$ $1 last; 
       rewrite ^(.+)$ /index.php?q=$1 last; 
      } 
     } 

     location ~* ^.+\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ 
     { 
      root /var/dev; 
      rewrite ^/.*(/wp-.*/.*\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ $1 last; 
      rewrite ^.*/files/(.*(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$/wp-includes/ms-files.php?file=$1 last; 
      expires 30d; 
      break; 
     } 

     location ~ wp\-.*\.php|wp\-admin|\.php$ { 
      include /etc/nginx/fastcgi_params; 
      fastcgi_pass 127.0.0.1:9000; 
      fastcgi_index index.php; 
      fastcgi_param SCRIPT_FILENAME /var/dev$fastcgi_script_name; 
     } 
} 

답변

관련 문제