歡迎您光臨本站 註冊首頁

還是關於NGINX的https問題的……在線等,急

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

還是關於NGINX的https問題的……在線等,急

在進行配置文件-t檢測的時候顯示OK的,然後我重啟了master服務,但是發現在https中的443這個埠沒有開,換了一個埠,然後再重啟結果還是沒有開。這是因為什麼啊?求大神們解答,因比較急……所以跪求大神速回
因為對方的http地址會自動跳轉到https同IP的不同埠,所以才會寫成這樣,但是我自己的443埠一直沒有……


下面是配置內容
#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    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       80;
        server_name  localhost;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        location / {
            root   html;
            index  index.html index.htm;
            proxy_pass http://X.X.X.X;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
     }


    server {
        listen       443;
        server_name  localhost;

        ssl                  on;
        ssl_certificate      /usr/local/nginx/conf/server.crt;
        ssl_certificate_key  /usr/local/nginx/conf/server.key;

        ssl_session_timeout  5m;

        ssl_protocols  SSLv2 SSLv3 TLSv1;
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers   on;

        location / {
            root   html;
            index  index.html index.htm;
            proxy_pass http://X.X.X.X;
        }
    }





}
《解決方案》

沒玩過,server{xxx}貌似需要放到https裡邊吧
《解決方案》

重啟下整個nginx服務看看443埠是否處於監聽狀態.
另外,先註釋掉https那個{}裡面的proxy語句測試下
《解決方案》

回復 3# chenyx
註釋掉了在HTTPS中的那個proxy_pass,但是443還是沒有,我就是直接查埠的,發現443這個埠完全沒有被任何進程監聽……當然,是重啟過的   
《解決方案》

配置沒看出問題,你看下nginx的日誌,看看有沒有錯誤
《解決方案》

回復 5# chenyx
後來改了下,本來對方的地址是先有HTTP,然後輸入的時候會自動轉到https,本來我的想法是先代對方的Http,然後再用443代他的https,就是之前用的。
後來試了直接用http代理對方的https……結果成功了一剛
這不科學啊
   

[火星人 ] 還是關於NGINX的https問題的……在線等,急已經有382次圍觀

http://coctec.com/docs/service/show-post-12255.html