在 Nginx 中将 Sonerezh 安装为子域名

在 Nginx 中将 Sonerezh 安装为子域名

安装 Sonerezh 时,系统提示我找不到安装。我输入了子域名 musica 的配置代码:

server {
            ## Escucha en el puerto 80 (HTTP)
            listen 80;

            server_name musica.dominio.com;

            location / {
                    return 301 https://$server_name$request_uri;
            }
}

server {
    ## Escucha en el puerto 443 (HTTPS)
    listen 443 ssl http2;

    server_name musica.dominio.com;

    ## Certificados
    ssl_certificate /etc/letsencrypt/live/musica.dominio.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/musica.dominio.com/privkey.pem;

    access_log /var/log/nginx/musica_access.log;
    error_log /var/log/nginx/musica_error.log;

    root /srv/www/musica;

    index index.html index.htm index.php;

    location ~ /.well-known {
            allow all;
    }


    location / {
        alias /srv/www/musica/app/webroot/;
        try_files $uri $uri/ //musica/index.php?$args;

        location ~* /([^/]+_[0-9]+x[0-9]+(@[0-9]+x)?\.[a-z]+)$ {
            try_files /img/resized/$1 /index.php?$args;
            add_header Cache-Control 'public';
            expires 14d;
            access_log off;
        }


        location ~ /(.+\.php)$ {
            alias /srv/www/musica/app/webroot/$1;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php/musica.sock;
            fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
            fastcgi_index index.php;
            include fastcgi_params;
        }
    }
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;
    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DH$
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:50m;
    ssl_stapling on;
    ssl_stapling_verify on;
    add_header Strict-Transport-Security max-age=15768000;

}

索涅列日

Sonerezh 的日志:

2017/05/18 08:31:31 [error] 1579#1579: *1502 open() "/srv/www/musica/install" failed (2: No such file or directory),

我修改了配置文件,但出现了 403 Forbidden 错误

server {
    ## Escucha en el puerto 80 (HTTP)
            listen 80;

            server_name musica.dominio.com;
            root /srv/www/musica/public_html/app/webroot;

        access_log /var/log/nginx/musica_access.log;
        error_log /var/log/nginx/musica_error.log;

    index index.php;

        location ~ /.well-known {
               allow all;
        }

        location / {
                try_files $uri $uri/ /index.php?$args;
                expires 14d;
                add_header Cache-Control 'public';
        }

       location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php/musica.sock;
            fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_intercept_errors off;
            fastcgi_buffer_size 16k;
            fastcgi_buffers 4 16k;
        }

}

答案1

最后更改文件夹的名称:

sonerezh ----- >> 音乐

重新启动服务器开始工作

相关内容