NGINX는 2개의 루트를 구성합니까?

NGINX는 2개의 루트를 구성합니까?

누군가가 나에게 올바른 방향을 알려줄 수 있는지 궁금합니다. 현재 SSL letsencrypt를 사용하여 NGINX가 rainloop와 함께 작동하도록 하면 훌륭하게 작동합니다. 이제 zpush를 사용하여 Active Sync를 작동시키려고 합니다. rainloop를 제거하여 작동하게 했습니다. 제 질문은 루트가 2개인 동일한 구성에서 rainloop와 zpush를 어떻게 가질 수 있습니까? 나는 매뉴얼을 보고 별칭을 보았지만 내가 올바르게 했는지 확신할 수 없었습니다. 이것이 내가 지금까지 얻은 것입니다.

Rainloop 및 zpush(구성되어야 한다고 생각하는 것)

 server {
server_name mail.mydomain.com;
root /var/www/rainloop/;
access_log /var/www/rainloop/logs/access.log;
error_log /var/www/rainloop/logs/error.log;
index index.php;

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_keep_conn on;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

location ~ /\.ht {
    deny all;
}

location ^~ /data {
  deny all;
}


location ^~ /zpush {
    alias /var/www/zpush;
    index index.php;

    try_files $uri $uri/ /zpush/index.php;
}

location /Microsoft-Server-ActiveSync {
    rewrite ^(.*)$  /index.php last;
}


listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/mail.mydomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mail.mydomain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


ssl_trusted_certificate /etc/letsencrypt/live/mail.mydomain.com/chain.pem; # managed by Certbot
ssl_stapling on; # managed by Certbot
ssl_stapling_verify on; # managed by Certbot

  }

   server {

   if ($host = mail.mydomain.com) {
    return 301 https://$host$request_uri;
 } # managed by Certbot


server_name mail.mydomain.com;
listen 80;
return 404; # managed by Certbot


   }

 # HTTP TO HTTPS REDIRECT
 server {
  listen 80;
  server_name mail.mydomain.com;
return 301 https://$host$request_uri;
}

그리고 이것은 내가 rainloop 안에 넣으려고 했지만 운이 없었던 내 zpush입니다.

server {
listen 443;
server_name mail.mydomain.com autodiscover.mydomain.com;

ssl on;
ssl_certificate         /etc/letsencrypt/live/mail.mydomain.com/fullchain.pem;
ssl_certificate_key     /etc/letsencrypt/live/mail.mydomain.com/privkey.pem;

#root    /usr/share/www;
root    /var/www/zpush;
index   index.php;

error_log /var/log/nginx/zpush-error.log;
access_log /var/log/nginx/zpush-access.log;

location / {
    try_files $uri $uri/ index.php;
}

location /Microsoft-Server-ActiveSync {
    rewrite ^(.*)$  /index.php last;
}



location ~ .php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param HTTPS on;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    # Z-Push Ping command will be alive for 470s, but be safe
    fastcgi_read_timeout 630;
  }

 }

감사합니다

관련 정보