2017-07-31 131 views
0

我用nginx在Debian上安装了Jekyll。通常我知道如何在使用php时保护我的web服务器。你可以用php-fpm和创建池来做到这一点。如何保护debian nginx web服务器

我目前nginx的配置:

server { 
    listen 80 ; 
    listen [::]:80; 

    return 301 https://$server_name$request_uri; 

    access_log /var/log/nginx/www.example.com-access.log timed; 
    error_log /var/log/nginx/www.example.com-error.log; 
    root /var/www/examplecom/html/_site; 
    server_name example.com www.example.com; 

     location/{ 
     index index.html index.php; 
     try_files $uri $uri/; 
     } 

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

} 

server { 
    listen 443 ssl; 
    listen [::]:443 ssl; 

    access_log /var/log/nginx/www.example.com-access.log timed; 
    error_log /var/log/nginx/www.example.com-error.log; 
    root /var/www/examplecom/html/_site; 
    server_name example.com www.example.com; 

    include snippets/ssl-example.com.conf; 
    include snippets/ssl-params.conf; 

    location/{ 
     index index.html index.php; 
     try_files $uri $uri/; 
    } 

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

} 

有谁知道如何保护我的化身。由于我不得不为此安装红宝石,我想保护我的Web服务器,如php-fpm池。

如果您需要关于我的设置的更多信息,请告诉我!

回答

2

由于Jekyll生成静态网站,因此安全漏洞与动态网站(如PHP和Python)相关性较低。 NGINX实际上有a guide on their website about what the configuration should be when hosting a static website.

安全的重要性对于客户来说更重要,这就是为什么你应该确保你的SSL/TLS设置是最佳的。 A decent guide for this can be found here.

不要忘记查看SSL实验室的实际配置强度。

+0

Hi @ samy-coenen,非常感谢您的帮助!我在ssl实验室的实力是+我认为这是配置好。在nginx的一面,我必须固定我的公钥来加强我的nginx配置。 – Noob