2017-07-31 133 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