2013-09-30 3 views
1

안녕하세요. 나는 웹 애플리케이션과 NGINX를 프록시로 사용한다. 그래서 내 메인 페이지가 http로 작동해야합니다. https가있는 다른 모든 페이지.단일 페이지의 https에서 nginx 리디렉션

server { 
     listen   80; 
     server_name    my-fin.ru www.my-fin.ru; 

     root   /usr/server/finance/abacus/webapp; 

     location ~ ^/.+\.(eot|ttf|woff)$ { 
      expires 1d; 
      add_header Cache-Control public; 
      add_header Access-Control-Allow-Origin *; 
     } 

     location ~ ^/.+\.(ico|jpg|jpeg|gif|pdf|jar|png|js|css|epf|svg)$ { 
      expires 1d; 
      add_header Cache-Control public; 
     } 
    location/{ 
       # give site more time to respond 
       proxy_read_timeout 120; 
       proxy_pass  http://127.0.0.1:8087; 
       proxy_redirect   http:// $scheme://; 

       proxy_set_header Host $host; 
       proxy_set_header X-Real-IP $remote_addr ; 
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ; 
     } 


} 

server { 
     listen   *:443; 
     server_name  my-fin.ru; 
     client_max_body_size 10m; 
     gzip     on; 
     gzip_min_length 500; 
     gzip_buffers 4 8k; 
     gzip_types    text/plain text/xml application/xml application/x-javascript text/javascript text/css text/json application/json; 

     access_log /var/log/nginx/finance.access.log; 
     error_log /var/log/nginx/finance.error.log; 

     ssl on; 
     ssl_certificate   /usr/server/myfin.crt; 
     ssl_certificate_key  /usr/server/myfin.key; 
     charset     utf-8; 

     root   /usr/server/finance/abacus/webapp; 

    rewrite https://my-fin.ru http://my-fin.ru;  
    location /logout { 
     return 301 http://my-fin.ru; 
    } 
     location ~ ^/.+\.(eot|ttf|woff)$ { 
      expires 1d; 
      add_header Cache-Control public; 
      add_header Access-Control-Allow-Origin *; 
     } 

     location ~ ^/.+\.(ico|jpg|jpeg|gif|pdf|jar|png|js|css|epf|svg)$ { 
      expires 1d; 
      add_header Cache-Control public; 
     } 
     location /features { 
       return 301 http://my-fin.ru/features; 
      } 
      location /price { 
       return 301 http://my-fin.ru/price; 
      } 
      location /help { 
       return 301 http://my-fin.ru/help; 
      } 
      location /about { 
       return 301 http://my-fin.ru/about; 
      } 

     location/{ 
       # give site more time to respond 
       proxy_read_timeout 120; 
       proxy_pass  http://127.0.0.1:8087/; 
       proxy_redirect   http:// $scheme://; 

       proxy_set_header Host $host; 
       proxy_set_header X-Real-IP $remote_addr ; 
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ; 
     } 

} 

그래서, 내가 https://domain.ru에서 http://domain.ru로 사용자를 리디렉션해야합니다

여기 내의 nginx의 설정입니다. https://domain.ru/help과 같은 모든 페이지에서 https 연결을 유지하는 것이 좋습니다.

도와주세요. 443 서버 블록

답변

0

넣어이

location =/{ 
     return 301 http://my-fin.ru/; 
    } 
관련 문제