NGINX:此处不允许使用“server”指令

时间:2017-03-31 13:25:51

标签: ubuntu nginx

我在配置中更改了任何内容,现在NGINX没有重启。

[emerg] 1363#0:/etc/nginx/sites-enabled/blog.conf:1中不允许使用“server”指令

这是我的nginx.conf:

http {
include       mime.types;

default_type  application/octet-stream;
include /etc/nginx/sites-enabled/*.conf;

sendfile        on;
keepalive_timeout  65;

server {

    location / {
    try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        include        fastcgi_params;
    }

    location ~ /\.ht {
        deny  all;
    }

    }
 }

这里是blog.conf

server {
listen 80;
server_name blog.DOMAIN.CC;

root /home/USER/ghost;
index index.html index.htm;

client_max_body_size 10G;

location / {
    proxy_pass http://localhost:2368;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
}


listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/punkti.co/fullchain.pem; # managed by             Certbot
ssl_certificate_key /etc/letsencrypt/live/punkti.co/privkey.pem; # managed by Certbot
ssl_session_cache shared:le_nginx_SSL:1m; # managed by Certbot
ssl_session_timeout 1440m; # managed by Certbot

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # managed by Certbot
ssl_prefer_server_ciphers on; # managed by Certbot

ssl_ciphers "xxxx"; # managed by Certbot



if ($scheme != "https") {
    return 301 https://$host$request_uri;
} # managed by Certbot


}

任何人都可以帮助我吗?

最佳, gummipunkt

0 个答案:

没有答案