nginx代理http和https配置

1.nginx-1.11.4-2\conf下放置配置文件:

mrtao.top.crt
mrtao.top.key

2.nginx配置https代理

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    
    
    server {
        listen       80;
        server_name  localhost;
		
	location /{
              proxy_connect_timeout   3;
              proxy_send_timeout      30;
              proxy_read_timeout      30;
			  
			  proxy_pass http://XXX.XXX.XXX.XXX:7575;
        }
	}
    
    
    server {
        listen       443;
        server_name  localhost;
		ssl on;
		ssl_certificate sslkey/mrtao.top.crt;
		ssl_certificate_key sslkey/mrtao.top.key;
		ssl_session_timeout 5m;
		ssl_ciphers ECDH:AESGCM:HIGH:!RC4:!DH:!MD5:!aNULL:!eNULL;
		ssl_prefer_server_ciphers on;
		
	location /{
              proxy_connect_timeout   3;
              proxy_send_timeout      30;
              proxy_read_timeout      30;
			  
			  proxy_pass http://XXX.XXX.XXX.XXX:7575;
        }
    }
}

你可能感兴趣的:(nignx)