Authored by hf

code review by hf: do modify passport module support https

@@ -23,44 +23,54 @@ server @@ -23,44 +23,54 @@ server
23 } 23 }
24 24
25 location = /reg.html { 25 location = /reg.html {
26 - proxy_redirect off;  
27 - proxy_pass http://yohobuy;  
28 - proxy_set_header Host $host;  
29 - proxy_set_header X-Real-IP $remote_addr;  
30 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
31 - proxy_set_header Accept-Encoding "gzip"; 26 + return 301 https://$server_name$request_uri;
  27 +
  28 +# proxy_redirect off;
  29 +# proxy_pass http://yohobuy;
  30 +# proxy_set_header Host $host;
  31 +# proxy_set_header X-Real-IP $remote_addr;
  32 +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  33 +# proxy_set_header Accept-Encoding "gzip";
32 } 34 }
33 location = /signin.html { 35 location = /signin.html {
34 - proxy_redirect off;  
35 - proxy_pass http://yohobuy;  
36 - proxy_set_header Host $host;  
37 - proxy_set_header X-Real-IP $remote_addr;  
38 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
39 - proxy_set_header Accept-Encoding "gzip"; 36 + return 301 https://$server_name$request_uri;
  37 +
  38 +# proxy_redirect off;
  39 +# proxy_pass http://yohobuy;
  40 +# proxy_set_header Host $host;
  41 +# proxy_set_header X-Real-IP $remote_addr;
  42 +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  43 +# proxy_set_header Accept-Encoding "gzip";
40 } 44 }
41 location = /login.html { 45 location = /login.html {
42 - proxy_redirect off;  
43 - proxy_pass http://yohobuy;  
44 - proxy_set_header Host $host;  
45 - proxy_set_header X-Real-IP $remote_addr;  
46 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
47 - proxy_set_header Accept-Encoding "gzip"; 46 + return 301 https://$server_name$request_uri;
  47 +
  48 +# proxy_redirect off;
  49 +# proxy_pass http://yohobuy;
  50 +# proxy_set_header Host $host;
  51 +# proxy_set_header X-Real-IP $remote_addr;
  52 +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  53 +# proxy_set_header Accept-Encoding "gzip";
48 } 54 }
49 location = /emailback.html { 55 location = /emailback.html {
50 - proxy_redirect off;  
51 - proxy_pass http://yohobuy;  
52 - proxy_set_header Host $host;  
53 - proxy_set_header X-Real-IP $remote_addr;  
54 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
55 - proxy_set_header Accept-Encoding "gzip"; 56 + return 301 https://$server_name$request_uri;
  57 +
  58 +# proxy_redirect off;
  59 +# proxy_pass http://yohobuy;
  60 +# proxy_set_header Host $host;
  61 +# proxy_set_header X-Real-IP $remote_addr;
  62 +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  63 +# proxy_set_header Accept-Encoding "gzip";
56 } 64 }
57 location = /phoneback.html { 65 location = /phoneback.html {
58 - proxy_redirect off;  
59 - proxy_pass http://yohobuy;  
60 - proxy_set_header Host $host;  
61 - proxy_set_header X-Real-IP $remote_addr;  
62 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
63 - proxy_set_header Accept-Encoding "gzip"; 66 + return 301 https://$server_name$request_uri;
  67 +
  68 +# proxy_redirect off;
  69 +# proxy_pass http://yohobuy;
  70 +# proxy_set_header Host $host;
  71 +# proxy_set_header X-Real-IP $remote_addr;
  72 +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  73 +# proxy_set_header Accept-Encoding "gzip";
64 } 74 }
65 location = /help/shareorder.html { 75 location = /help/shareorder.html {
66 root /Data/code/git/yohobuy/yohobuy/assets; 76 root /Data/code/git/yohobuy/yohobuy/assets;
@@ -70,28 +80,34 @@ server @@ -70,28 +80,34 @@ server
70 expires 7d; 80 expires 7d;
71 } 81 }
72 location ^~ /passport/reg { 82 location ^~ /passport/reg {
73 - proxy_redirect off;  
74 - proxy_pass http://yohobuy;  
75 - proxy_set_header Host $host;  
76 - proxy_set_header X-Real-IP $remote_addr;  
77 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
78 - proxy_set_header Accept-Encoding "gzip"; 83 + return 301 https://$server_name$request_uri;
  84 +
  85 +# proxy_redirect off;
  86 +# proxy_pass http://yohobuy;
  87 +# proxy_set_header Host $host;
  88 +# proxy_set_header X-Real-IP $remote_addr;
  89 +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  90 +# proxy_set_header Accept-Encoding "gzip";
79 } 91 }
80 location ^~ /passport/login { 92 location ^~ /passport/login {
81 - proxy_redirect off;  
82 - proxy_pass http://yohobuy;  
83 - proxy_set_header Host $host;  
84 - proxy_set_header X-Real-IP $remote_addr;  
85 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
86 - proxy_set_header Accept-Encoding "gzip"; 93 + return 301 https://$server_name$request_uri;
  94 +
  95 +# proxy_redirect off;
  96 +# proxy_pass http://yohobuy;
  97 +# proxy_set_header Host $host;
  98 +# proxy_set_header X-Real-IP $remote_addr;
  99 +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  100 +# proxy_set_header Accept-Encoding "gzip";
87 } 101 }
88 location ^~ /passport/back { 102 location ^~ /passport/back {
89 - proxy_redirect off;  
90 - proxy_pass http://yohobuy;  
91 - proxy_set_header Host $host;  
92 - proxy_set_header X-Real-IP $remote_addr;  
93 - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
94 - proxy_set_header Accept-Encoding "gzip"; 103 + return 301 https://$server_name$request_uri;
  104 +
  105 +# proxy_redirect off;
  106 +# proxy_pass http://yohobuy;
  107 +# proxy_set_header Host $host;
  108 +# proxy_set_header X-Real-IP $remote_addr;
  109 +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  110 +# proxy_set_header Accept-Encoding "gzip";
95 } 111 }
96 112
97 location = / { 113 location = / {
@@ -364,4 +380,78 @@ server @@ -364,4 +380,78 @@ server
364 380
365 } 381 }
366 382
  383 +server
  384 +{
  385 + listen 80;
  386 + server_name huodong.m.yohobuy.com;
  387 + root /Data/PE/yohobuy/yohobuy/huodong.m.yohobuy.com/public;
  388 + location / {
  389 + proxy_redirect off;
  390 + proxy_pass http://yohobuy;
  391 + proxy_set_header Host $host;
  392 + proxy_set_header X-Real-IP $remote_addr;
  393 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  394 + proxy_set_header Accept-Encoding "gzip";
  395 + }
  396 +
  397 + location ~* \.(ico|woff|svg|eot|ttf|otf)$ {
  398 + expires 30d;
  399 + }
  400 + location =/crossdomain.xml {
  401 + expires 30d;
  402 + }
  403 + location =/sitemap.xml {
  404 + expires 1d;
  405 + }
  406 + location =/robots.txt {
  407 + expires 1d;
  408 + }
  409 +}
  410 +
  411 +server
  412 +{
  413 + listen 443 ssl;
  414 + server_name login.m.yohobuy.com;
  415 + root /Data/PE/yohobuy/yohobuy/m.yohobuy.com/public;
  416 +
  417 + ssl_certificate /home/hf/ssl/server.crt;
  418 + ssl_certificate_key /home/hf/ssl/server.key;
  419 + ssl_dhparam /home/hf/ssl/dhparams.pem;
  420 +
  421 + ssl_prefer_server_ciphers on;
  422 + ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  423 + ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:DES-CBC3-SHA";
  424 + ssl_session_tickets off;
  425 + ssl_session_cache shared:SSL:10m;
367 426
  427 +# add_header Strict-Transport-Security "max-age=31536000";
  428 +# add_header X-Frame-Options deny;
  429 +# add_header X-Content-Type-Options nosniff;
  430 +
  431 + location / {
  432 + proxy_redirect off;
  433 + proxy_pass http://yohobuy;
  434 + proxy_set_header Host $host;
  435 + proxy_set_header X-Real-IP $remote_addr;
  436 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  437 + proxy_set_header Accept-Encoding "gzip";
  438 + }
  439 +
  440 + location ^~ /dist/ {
  441 + root /Data/PE/yohobuy/yohobuy/static;
  442 + expires 30d;
  443 + }
  444 +
  445 + location ~* \.(ico|woff|svg|eot|ttf|otf)$ {
  446 + expires 30d;
  447 + }
  448 + location =/crossdomain.xml {
  449 + expires 30d;
  450 + }
  451 + location =/sitemap.xml {
  452 + expires 1d;
  453 + }
  454 + location =/robots.txt {
  455 + expires 1d;
  456 + }
  457 +}
1 -{{> layout/header}} 1 +{{> layout/header_passport}}
2 <div class="login-page passport-page yoho-page"> 2 <div class="login-page passport-page yoho-page">
3 {{> passport/header}} 3 {{> passport/header}}
4 <div class="content"> 4 <div class="content">
@@ -41,4 +41,4 @@ @@ -41,4 +41,4 @@
41 </ul> 41 </ul>
42 </div> 42 </div>
43 </div> 43 </div>
44 -{{> layout/footer}}  
  44 +{{> layout/footer_passport}}
1 -{{> layout/header}} 1 +{{> layout/header_passport}}
2 <div class="login-international-page passport-page yoho-page"> 2 <div class="login-international-page passport-page yoho-page">
3 {{> passport/header}} 3 {{> passport/header}}
4 <div class="content"> 4 <div class="content">
@@ -13,4 +13,4 @@ @@ -13,4 +13,4 @@
13 <span id="btn-login" class="btn btn-login disble row">登录</span> 13 <span id="btn-login" class="btn btn-login disble row">登录</span>
14 </div> 14 </div>
15 </div> 15 </div>
16 -{{> layout/footer}}  
  16 +{{> layout/footer_passport}}
1 -{{> layout/header}} 1 +{{> layout/header_passport}}
2 <div class="reg-code-page passport-page yoho-page"> 2 <div class="reg-code-page passport-page yoho-page">
3 {{> passport/code}} 3 {{> passport/code}}
4 </div> 4 </div>
5 -{{> layout/footer}}  
  5 +{{> layout/footer_passport}}
1 -{{> layout/header}} 1 +{{> layout/header_passport}}
2 <div class="reg-page passport-page yoho-page"> 2 <div class="reg-page passport-page yoho-page">
3 {{> passport/header}} 3 {{> passport/header}}
4 <div class="content"> 4 <div class="content">
@@ -11,4 +11,4 @@ @@ -11,4 +11,4 @@
11 <p class="register-tip">YOHO!Family账号可登录Yoho!Buy有货、YOHO!Boys、YOHO!Girls及SHOW</p> 11 <p class="register-tip">YOHO!Family账号可登录Yoho!Buy有货、YOHO!Boys、YOHO!Girls及SHOW</p>
12 </div> 12 </div>
13 </div> 13 </div>
14 -{{> layout/footer}}  
  14 +{{> layout/footer_passport}}
1 -{{> layout/header}} 1 +{{> layout/header_passport}}
2 <div class="reg-password-page passport-page yoho-page"> 2 <div class="reg-password-page passport-page yoho-page">
3 {{> passport/header}} 3 {{> passport/header}}
4 <div class="content"> 4 <div class="content">
@@ -20,4 +20,4 @@ var r=b.getElementsByTagName('script')[0];r.parentNode.insertBefore(s,r); @@ -20,4 +20,4 @@ var r=b.getElementsByTagName('script')[0];r.parentNode.insertBefore(s,r);
20 _agtjs('init','AG_052186_PHCW','yohobuy.com'); 20 _agtjs('init','AG_052186_PHCW','yohobuy.com');
21 _agtjs('loadEvent',{atsev:101,'atsrmv':""}); 21 _agtjs('loadEvent',{atsev:101,'atsrmv':""});
22 </script> 22 </script>
23 -{{> layout/footer}}  
  23 +{{> layout/footer_passport}}
@@ -26,5 +26,4 @@ @@ -26,5 +26,4 @@
26 s.parentNode.insertBefore(hm, s); 26 s.parentNode.insertBefore(hm, s);
27 })(); 27 })();
28 </script> 28 </script>
29 -<script src="http://static.yohobuy.com/js/analytics/analysis.js"></script>  
30 -<script src="http://static.yohobuy.com/m/v1/js/om_code.js"></script> 29 +<script src="/dist/analysis/v1/js/om_code.js"></script>
1 {{> layout/page_footer}} 1 {{> layout/page_footer}}
2 {{> layout/download_app}} 2 {{> layout/download_app}}
3 {{#if hasWxShare}} 3 {{#if hasWxShare}}
4 -<script type="text/javascript" charset="utf-8" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> 4 +<script type="text/javascript" charset="utf-8" src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
5 {{/if}} 5 {{/if}}
6 {{#if rlsEnv}} 6 {{#if rlsEnv}}
7 <script src="/dist/myohobuy/{{version}}/lib.js"></script> 7 <script src="/dist/myohobuy/{{version}}/lib.js"></script>
@@ -19,17 +19,6 @@ @@ -19,17 +19,6 @@
19 <script src="http://localhost:8000/static/js/sea.js?nowrap"></script> 19 <script src="http://localhost:8000/static/js/sea.js?nowrap"></script>
20 <script>seajs.config({base: 'http://localhost:8000/'});</script> 20 <script>seajs.config({base: 'http://localhost:8000/'});</script>
21 {{/if}} 21 {{/if}}
22 -<script type="text/javascript">  
23 - (function(w,d,s,j,f){  
24 - w['YohoAcquisitionObject']=f;  
25 - w[f]=function(){w[f].p=arguments;};  
26 - var a=d.createElement(s);  
27 - var m=d.getElementsByTagName(s)[0];  
28 - a.async=1;  
29 - a.src=j;  
30 - m.parentNode.insertBefore(a,m);  
31 - })(window,document,'script','/dist/yas-jssdk/{{yas_version}}/yas.js','_yas');  
32 -</script>  
33 {{> layout/use}} 22 {{> layout/use}}
34 {{> layout/analysis_passport}} 23 {{> layout/analysis_passport}}
35 </body> 24 </body>