1. 程式人生 > >nginx配置http和https記錄

nginx配置http和https記錄

server {
        listen       80;
        server_name  localhost;


        #charset koi8-r;


        #access_log  logs/host.access.log  main;


        location / {
#rewrite ^ https://$host$request_uri  permanent;
#proxy_pass https://localhost;
            root   /home;
            index  index.html index.htm;
        }
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

    }

# HTTPS server
    #
    server {
        listen       443 ssl;
        server_name  localhost;

ssl_certificate 1_api.fengjunchao.com_bundle.crt;
        ssl_certificate_key 2_api.fengjunchao.com.key;
        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
    #        root   html;
proxy_pass http://index.jwell56.com;
#proxy_pass  http://221.237.162.142:12120;
     #       index  index.html index.htm;
        }
    }