NGINX的别名?

时间:2018-09-16 18:15:21

标签: nginx rainloop

我目前让Rainloop与mail.mydomain.com一起正常工作。现在,我想安装zpush并将Rainloop作为别名,例如:mail.mydomain.com/rainloop,并将zpush保留为mail.mydomain.com(用于自动发现)。这就是我到目前为止

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

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

   location ~ \.php$ {
       fastcgi_index index.php;
       # fastcgi_param HTTPS on;
       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;
       # Z-Push Ping command will be alive for 470s, but be safe
    fastcgi_read_timeout 630;

   }

   location ~ /\.ht {
       deny all;
   }

   location ^~ /data {
     deny all;
   }

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

   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

}

不确定我做错了什么,或者我错过了什么吗?继续获取403

1 个答案:

答案 0 :(得分:0)

已解决问题:需要创建符号链接

     ln -s /var/www/rainloop  /var/www/zpush