Nginx代理配置ssl

项目上,例如geoserver等中间件,没有自带ssl。

到了客户那边,又要求增加https,只能用nginx这一神器了。

nginx.conf如下

http {
    server_tokens off;
    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;

     server {
	  listen       31111 ssl;
	  server_name  192.168.123.200;
	  ssl_certificate      E:/ssl/server.crt;
      ssl_certificate_key  E:/ssl/server.key;
      add_header X-Frame-Options SAMEORIGIN;
      ssl_session_cache    shared:SSL:1m;
      ssl_session_timeout  5m;
      ssl_ciphers  HIGH:!aNULL:!MD5;
      ssl_prefer_server_ciphers  on;
	  location / {
		 proxy_set_header Host $http_host;
         proxy_pass http://192.168.100.100:31110;
	  }
	  	    
    } 
}

ssl证书下载地址

https://download.csdn.net/download/gdczcwq/87119789

你可能感兴趣的:(nginx,ssl,nginx,服务器)