通过nginx反向链接https的域名

113 阅读1分钟

直接上配置文件

user  nginx; 
worker_processes  auto; 
 
error_log  /var/log/nginx/error.log notice; 
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; 
    #这个很重要因为https是加密传输所以缓冲区要大,一般都是这个地方出的问题
    proxy_buffer_size   64k; 
    proxy_buffers       32      64k; 
    proxy_busy_buffers_size     128k;    
 
    sendfile        on; 
    #tcp_nopush     on; 
 
    keepalive_timeout  65; 
 
    #gzip  on; 
 
    include /etc/nginx/conf.d/*.conf; 
}
server {
    listen       800;
    server_name  localhost;
    location / {
        proxy_pass https://www.taorenju.com; 
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}