微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

nginx 配置https访问

server {
 listen 443;
 server_name ssl.17byh.com;
 ssl on;
 ssl_certificate sslkey/1_ssl.17byh.com_bundle.crt;
 ssl_certificate_key sslkey/2_ssl.17byh.com.key;
 ssl_session_timeout 5m;
 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
 #ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_prefer_server_ciphers on;

    access_log /data/wwwlogs/access_Nginx_ssl.17byh.com.log combined;
    root /mnt/www/plist_www;
    index index.html index.htm index.PHP;

    include rewrite/thinkPHP.conf;

    location /Nginx_status {
      stub_status on;
      access_log off;
      allow 127.0.0.1;
      deny all;
    }

    location ~ index\.PHP(/|$) {
      #fastcgi_pass remote_PHP_ip:9000;
      fastcgi_pass unix:/dev/shm/php-cgi.sock;
      fastcgi_index index.PHP;
            fastcgi_split_path_info  ^(.+index\.PHP)(/.*)$;
      fastcgi_param  PATH_INFO $fastcgi_path_info;
      include fastcgi.conf;
    }
    location ~ admin\.PHP(/|$) {
      #fastcgi_pass remote_PHP_ip:9000;
      fastcgi_pass unix:/dev/shm/php-cgi.sock;
      fastcgi_index admin.PHP;
      fastcgi_split_path_info  ^(.+admin\.PHP)(/.*)$;
      fastcgi_param  PATH_INFO $fastcgi_path_info;
      try_files $uri $uri/ /admin.PHP?s=$fastcgi_path_info;
      include fastcgi.conf;
    }
    location ~ [^/]\.PHP(/|$) {
        #default_type    text/plain;
        #return 502 "服务正在升级,请稍后再试……";
        deny all;
	#allow all;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
        expires 30d;
        access_log off;
    }

    location ~ .*\.(js|css)?$ {
        expires 7d;
        access_log off;
    }

    location ~ /\.ht {
        deny all;
    }
 }

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐