使用子域而不是其他子域

时间:2017-10-06 21:19:07

标签: nginx subdomain subdirectory nextcloud

我知道这个问题太多但是我真的不明白。

我正在为我的服务器使用subdomain,例如sub.domain.com。我可以通过输入ssh root@sub.domain.com与ssh联系。

我正在尝试在此服务器上使用nextcloud,例如cloud.domain.com。当我键入sub.domain.com/nextcloud时,我可以访问nextcloud。我的conf文件是:

   upstream php-handler {
    server 127.0.0.1:9000;
    #server unix:/var/run/php5-fpm.sock;
}
server {
    listen 80;
    server_name sub.domain.com;
    # enforce https
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    server_name sub.domain.com;

    ssl_certificate /etc/nginx/ssl/server.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;   

   # Add headers to serve security related headers
    # Before enabling Strict-Transport-Security headers please read into this
    # topic first.
    add_header Strict-Transport-Security "max-age=15768000;
    includeSubDomains; preload;";
    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;

   # Path to the root of your installation
    root /usr/share/nextcloud/;

   location = /robots.txt {
       allow all;
       log_not_found off;
       access_log off;
   }

我正在尝试将sub.domain.com更改为cloud.domain.com,但它无效。

我的错误在哪里?你能帮助我吗?

感谢。

0 个答案:

没有答案