阿里雲ssl tomcat nginx https

    server {
       listen 80 default;
       return 404;
    }


    server {
  		listen 80;
  		server_name www.test.com;
  		return 301 https://$host$request_uri;
	}




server {
    listen 443;
    server_name www.test.com;
	ssl on;
    ssl_certificate   ../cert/1.pem;
    ssl_certificate_key  ../cert/2.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;


    location / {
    			 if ($args ~* "redirect:") {
       				 return 403;
  			  }
			 if ($args ~* "action:") {
        			return 403;
  			  }
			 if ($args ~* "redirectAction:") {
       				 return 403;
   			 }
    proxy_set_header  X-Forwarded-Host $host;
    proxy_set_header  X-Forwarded-Proto $scheme;
    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    expires off;
    sendfile off;
    proxy_pass http://www.test.com:8080;
  }
}

發佈了18 篇原創文章 · 獲贊 2 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章