Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ubuntu 14.04上使用nginx的SSL的正确ufw规则_Ubuntu_Ssl_Nginx_Lets Encrypt_Ufw - Fatal编程技术网

ubuntu 14.04上使用nginx的SSL的正确ufw规则

ubuntu 14.04上使用nginx的SSL的正确ufw规则,ubuntu,ssl,nginx,lets-encrypt,ufw,Ubuntu,Ssl,Nginx,Lets Encrypt,Ufw,我在ubuntu14.04上的nginx上安装了一个NodeJs应用程序。我正在尝试通过letsencrypt使用ssl保护此站点。包括diffie-hellman参数在内的所有证书都正确生成。此应用程序通过VPN连接提供服务,因此我感觉问题与防火墙和/或网络设置有关 nginx server { listen 80; server_name sample.com; # listen [::]:80 default_server ipv6only=on; retu

我在
ubuntu14.04
上的
nginx
上安装了一个
NodeJs
应用程序。我正在尝试通过
letsencrypt
使用
ssl
保护此站点。包括diffie-hellman参数在内的所有证书都正确生成。此应用程序通过VPN连接提供服务,因此我感觉问题与防火墙和/或网络设置有关

nginx

server {
    listen 80;
    server_name sample.com;
    # listen [::]:80 default_server ipv6only=on;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    # listen [::]:443 ssl;
    server_name sample.com;

    ssl_certificate /etc/letsencrypt/live/sample.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/sample.com/privkey.pem;

    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:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AE$
    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;

    location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-NginX-Proxy true;
            proxy_pass http://localhost:8000;
            proxy_ssl_session_reuse off;
            proxy_set_header Host $http_host;
            proxy_cache_bypass $http_upgrade;
            proxy_redirect off;
    }
}
ufw

注释

我还注意到nodejs应用程序有一个奇怪的行为。每当我执行
sudo ufw enable
(加上规则)时,服务器将在几秒钟后停止工作。但在我执行
sudo ufw disable
后,它将再次工作