2013-05-08 61 views
1

我正在使用Ruby on Rails,使用nginx作爲Web服務器和獨角獸作爲應用程序服務器。我試圖爲我的應用程序和它的作品完美地配置ssl。我使用的nginx配置如下。Ajax Popup配置ssl時未加載Windows

upstream unicorn_domain { 
    # This is the socket we configured in unicorn.rb 
server unix:/home/ubuntu/root_path/tmp/sockets/unicorn.sock fail_timeout=30; 
} 
server { 
     listen 80; 
     server_name demo.domain.com; 
     rewrite^https://demo.domain.com$request_uri? permanent; 
     } 
server { 
    listen 443 ssl; 
    client_max_body_size 4G; 
    server_name demo.domain.com; 
    ssl     on; 
    ssl_certificate  /etc/nginx/ssl/example.com_chain.pem; 
    ssl_certificate_key /etc/nginx/ssl/example.com.key; 
    ssl_protocols   SSLv3 TLSv1; 
    ssl_ciphers   ALL:-ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP; 
    ssl_session_cache  shared:SSL:10m; 


    keepalive_timeout 5; 

    # Location of our static files 
    root /home/ubuntu/root_path/public; 
    access_log /home/ubuntu/root_path/log/nginx/nginx.access.log; 
    location/{ 


     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
     proxy_set_header Host $http_host; 
     proxy_redirect off; 

     # If you don't find the filename in the static files 
     # Then request it from the unicorn server 
     if (!-f $request_filename) { 
      proxy_pass https://unicorn_domain; 
      break; 
     } 

     if ($request_uri ~* "\.(ico|css|js|gif|jpe?g|png)\?[0-9]+$") { 
     expires max; 
     break; 
    } 

    } 
} 

但我的應用程序的主頁是建立主要是使用JavaScript和它具有彈出AJAX的窗戶被點擊action.Here問題來了含有某種形式的多個按鈕。當我們將ssl配置到站點時,窗口不會彈出。它只發生在主頁上。在裏面的頁面功能正在工作。任何人都可以幫助我找到解決方案。

謝謝你, 問候

+0

你能後的JavaScript網址在您的應用程序,比如'' – 2013-05-08 17:39:10

+0

@menon,現在是否適合你。因爲我面臨同樣的問題。 – 2015-01-21 06:56:27

+1

@manish,你可以檢查JavaScript的主機方案是http://而不是https:// – apr 2015-01-21 09:56:06

回答