Nginx仅显示欢迎页面

时间:2019-01-20 15:28:18

标签: nginx

我只是为子域设置了nginx,即使如此,我仍然只获得“欢迎”页面。

这是我在nginx网站上设置的代码

server {
    listen 80;

    server_name sub.domain.ro;

    rewrite ^ https://sub.domain.ro$request_uri? permanent;
}

server {
    listen 443 ssl http2;

    # ssl_certificate /etc/letsencrypt/live/testsite.com/fullchain.pem;
    # ssl_certificate_key /etc/letsencrypt/live/testsite.com/privkey.pem;
    # ssl_stapling on;

    server_name sub.domain.ro;

    root /var/www/sub.domain.ro;

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

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

}

请让我知道我做错了什么或在这里忘记了什么。

0 个答案:

没有答案