美文网首页
nginx HTTPS 手动

nginx HTTPS 手动

作者: 小虾米QAQ | 来源:发表于2018-02-05 15:53 被阅读15次

需要配置 nginx.conf

server {

                listen 80;

                server_name run.siiva.cn;

                #告诉浏览器有效期内只准用 https 访问

                add_header Strict-Transport-Security max-age=15768000;

                #永久重定向到 https 站点

                return 301 https://$server_name$request_uri;

        }

        server {

                #启用 https, 使用 http/2 协议, nginx 1.9.11 启用 http/2 会有bug, 已在 1.9.12 版本中修复.

                listen 443 ssl http2 fastopen=3 reuseport;

                server_name run.siiva.cn;

                #告诉浏览器不要猜测mime类型

                add_header X-Content-Type-Options nosniff;

                ssl on;

                ssl_certificate /etc/letsencrypt/live/run.siiva.cn/fullchain.pem;

                ssl_certificate_key /etc/letsencrypt/live/run.siiva.cn/privkey.pem;

                location / {

                        proxy_pass http://175.102.16.230:3000;

                        proxy_set_header Upgrade $http_upgrade;

                        proxy_set_header Connection "upgrade";

                        proxy_http_version 1.1;

                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                        proxy_set_header Host $host;

                }

详见

相关文章

  • nginx HTTPS 手动

    需要配置nginx.conf server { listen 80; server...

  • NGINX和PHP 使用SOCKET通信错误 An error

    环境:centos7.5 、NGINX、PHP7.2 (php和nginx都是全麻编译安装手动配置) 将nginx...

  • nginx - https

    1、http 重定向 [图片上传失败...(image-ca2188-1534050760876)] 2、一台主机...

  • nginx -- https

    测试配置是否有语法错误:nginx -t -c /usr/local/nginx/conf/nginx.conf输...

  • nginx https

    nginx -v nginx -V nginx -t 2.nginx.conf https配置 注意事...

  • Nginx https

    如何获得这两个材料,请查看我的文章《Apache https》,这里不在累述。

  • Nginx HTTPS

    准备工作 获取HTTP证书并上传到服务器 配置Nignx支持HTTPS协议,首先需要检查Nginx是否已经安装了S...

  • Nginx https

    要在nginx中配置https,就必须安装ssl模块,也就是: http_ssl_module进入到nginx的解...

  • nginx安装

    ======安装Nginx下载下面4个包 手动下载nginx-rtmp-module放在/usr/local/rt...

  • 常见系统安装

    nginx 参考文件:nginx中文文档,https://www.nginx.cn/install[https:/...

网友评论

      本文标题:nginx HTTPS 手动

      本文链接:https://www.haomeiwen.com/subject/xecizxtx.html