nginx::配置https/反向代理

vim /etc/nginx/nginx.conf

 

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/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  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;

        server {
                listen       443 ssl http2 default_server;
                listen       [::]:443 ssl http2 default_server;
                server_name  _;
                root /var/www;
                ssl_certificate "xxx.pem";
                ssl_certificate_key "xxx.key";
                ssl_session_cache shared:SSL:1m;
                ssl_session_timeout  10m;
                ssl_ciphers HIGH:!aNULL:!MD5;
                ssl_prefer_server_ciphers on;
                location / {
                }
                location /wx/api {
                        proxy_pass http://127.0.0.1:4999;
                }
        } 
}

 

posted @ 2019-07-09 13:24  osbreak  阅读(4172)  评论(0编辑  收藏  举报