首页 > 系统相关 >nginx hyperf ssl https 环境。hyperf-https-ssl

nginx hyperf ssl https 环境。hyperf-https-ssl

时间:2023-04-04 10:04:52浏览次数:33  
标签:set http log ssl hyperf proxy https error

 

user nginx nginx;
worker_processes  8;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    upstream hyperf {
        # Hyperf HTTP Server 的 IP 及 端口
        server 127.0.0.1:9501;
    }

    server {
        # 监听端口
        listen 80;
        # 绑定的域名,填写您的域名
        server_name www.heijinli.cn;

        location / {
            # 将客户端的 Host 和 IP 信息一并转发到对应节点  
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

            # 执行代理访问真实服务器
            # proxy_pass http://hyperf;
        }
    }

    # HTTPS server
    #
    server {
        server_name  heijinli.cn;
        listen       443;
        ssl on;

        ssl_certificate      /usr/local/nginx/conf/cert/www.heijinli.cn.cer;
        ssl_certificate_key  /usr/local/nginx/conf/cert/www.heijinli.cn.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  300m;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !MEDIUM";
        ssl_prefer_server_ciphers  on;

        client_max_body_size 8M;

        location / {
            proxy_redirect off;
            proxy_pass http://127.0.0.1:9501;
            proxy_set_header Host $host;
            proxy_set_header X-Real_IP $remote_addr;
            proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection upgrade;
        }

        #error_page 404 /404.html;
    
        # redirect server error pages to the static page /50x.html
        #
        error_page 500 502 503 504 /50x.html;

        location = /50x.html {
            root /usr/share/nginx/html;
        }

    }

}

标签:set,http,log,ssl,hyperf,proxy,https,error
From: https://www.cnblogs.com/yzl042349/p/17285395.html

相关文章

  • hyperf如何热启动,热更新,更改代码自动重启
     1、热更新Watcher2、安装composerrequirehyperf/watcher--dev3、生成配置文件phpbin/hyperf.phpvendor:publishhyperf/watcher所在目录:config/autoload/watcher.php    4、启动phpbin/hyperf.phpserver:watch   netstat-anp|grep9501 ......
  • Windows用内网跑https
    1、windows系统:直接下载解压即可。下载链接:https://pan.baidu.com/s/11js65YwFdKaBifxOi-xA5g?pwd=8855  提取码:88552.安装CA根证书到本地,下载程序进行解压,放到windows相应目录并解压,以管理员身份运行下面指令(mkcert表示mkcert-v1.4.1-windows-amd64.exe的完整路径加+mkc......
  • Sevlet规范:HttpServlet类 和 HttpServletRequest接口 源码解析
    Sevlet规范:HttpServlet类和HttpServletRequest接口源码解析每博一文案命运总是不如人愿,但往往是在无数的痛苦总,在重重的矛盾和艰辛中,才是人成熟起来。你,为这瞬间的辉煌,忍耐了多少暗淡无光的日月,你会死亡,但你也会证明生命有多强大。一次邂逅,一次目光的交融,就是永远的合二为......
  • 怎么在springboot中配置https证书的详细教程
    前言由于小程序需要https,然后之前申请的域名过期了,用了两年由于忘记续费要将域名赎回居然要1200....想了一下之前还有另一个域名,干脆就用这个域名弄个二级域名出来,所以二级域名建立出来后需要在springboot项目上开启https访问废话不多说,开整在阿里云新建二级域名这个......
  • php-websocket hyperf/websocket-server/client 客户端和服务器实时双向数据传输
    WebSocket服务WebSocket是一种通信协议,可在单个TCP连接上进行全双工通信。WebSocket使得客户端和服务器之间的数据交换变得更加简单,允许服务端主动向客户端推送数据。在WebSocketAPI中,浏览器和服务器只需要完成一次握手,两者之间就可以建立持久性的连接,并进行双向数据传输。Hyperf......
  • 网站https加密
    Whenaclient(e.g.,awebbrowser)establishesasecureHTTPSconnectionwithaserver,thefollowingstepsoccurtoensurethesecurityofthecommunication:TheclientinitiatestheHTTPSconnectionbyrequestingasecureresourcefromtheserver,ty......
  • 如何使用HTTPS加密保护网站?
    加密Web内容并不是什么新鲜事:自发布通过SSL/TLS协议来加密Web内容的规范以来,已经过去了近20年。然而,近年来,运行安全的HTTPS加密Web服务器已经从一种选择变成了一种安全防护的必需品。攻击者继续寻找并找到窃取用户和Web服务之间发送的信息的方法,通常是通过利用通过超文本......
  • vue 项目启动报错opensslErrorStack ERR_OSSL_EVP_UNSUPPORTED
     错误裁图  原因:node升级版本过高 解决办法:windows中在vscode里在命令行输入命令修改环境变量:$env:NODE_OPTIONS="--openssl-legacy-provider"再执行:npmrunserve  linux中exportNODE_OPTIONS=--openssl-legacy-provider  ......
  • TCP/IP和OSI的基础层级关系图,TCP/IP四层模型关系,TCP/IP和HTTP/HTTPS的关系图
    TCP/传输控制协议英文全称TransmissionControlProtocol。 IP/网际互连协议英文全称InternetProtocol。tcp和ip是互联网众多通信协议中最为著名的。1.OSI参考模型与TCP/IP的关系计算机网络分层模型OSI七层模型TCP/IP四层模型TCP/IP五层模型应用层应用层应用层应用程序表示层会......
  • mqtt启用ssl参考(2)
    1.WefirstneedtoinstallOpenSSLinordertocreateourcertificatesandkeys.ClickhereforGitHuborherefortheexe.2.CreateCAkeypair:NavigatetotheWindowsstartandsearchOpenSSL.Hitenteron"OpenSSLCommandPromt".Makesurey......