2016-06-22 5 views
0

/var/www/html/test,/var/www/html/test1 등 많은 프로젝트가 있습니다. 내 도메인을이 폴더 중 하나에 연결하고 싶습니다. OS가 Debian입니다. 여기에 내 사이트 이용 가능한 설정Nginx를 사용하여 하위 폴더에 도메인 추가

server { 
    server_name example.me; 

    root /var/www/html/example.me; 
    index index.html index.php; 

    # set expiration of assets to MAX for caching 
    location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { 
      expires max; 
      log_not_found off; 
    } 

    location/{ 
      # Check if a file or directory index file exists, else route it to index.php. 
      try_files $uri $uri/ /index.php; 
    } 

    location ~* \.php$ { 
      fastcgi_pass 127.0.0.1:9000; 
      include fastcgi.conf; 
    } 

} 내가 어떤이 하나 들으 많이 좀 도와 희망

입니다.

+0

사이트에 심볼릭 링크가 활성화되어 있습니까? –

답변

1

다음은 test 폴더를 example.me에 게시합니다.

    root /var/www/html/example.me; root /var/www/html/test;-
  • 복사를 변경하거나 다른 사이트의 설정 파일에 올바른으로 test1sites-enabled
  • 다시 시작 nginx를

반복 동일한 프로세스에 사이트 구성 파일을 심볼릭 링크

  • server_nameroot.

  • 관련 문제