Windows环境nginx在phpStudy下配置https
Nginx配置文件内容如下#power by www.php.cn
#usernobody;
worker_processes1;
#error_loglogs/error.log;
#error_loglogs/error.lognotice;
#error_loglogs/error.loginfo;
#pid logs/nginx.pid;
events {
worker_connections1024;
}
http {
include mime.types;
default_typeapplication/octet-stream;
#log_formatmain'$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_loglogs/access.logmain;
sendfile on;
#tcp_nopush on;
#keepalive_timeout0;
keepalive_timeout65;
#tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length1k;
gzip_buffers 4 32k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
gzip_disable "MSIE .";
server_names_hash_bucket_size 128;
client_max_body_size 100m;
client_header_buffer_size 256k;
large_client_header_buffers 4 256k;
server {
listen 80;
server_namelocalhost;
#charset koi8-r;
#access_loglogs/access.logmain;
root "D:/WWW";
location / {
indexindex.html index.htm index.php l.php;
autoindexoff;
}
error_page 500 502 503 504/50x.html;
location ~ \.php(.*)${
#root "D:/WWW";
fastcgi_pass 127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_split_path_info^((?U).+\.php)(/?.+)$;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
fastcgi_paramPATH_INFO$fastcgi_path_info;
fastcgi_paramPATH_TRANSLATED$document_root$fastcgi_path_info;
include fastcgi_params;
}
}
# HTTPS server
server {
listen 443;
server_namelocalhost;
ssl on;
ssl_certificate D:/phpStudy2018/PHPTutorial/ssl/openssl.crt;
ssl_certificate_keyD:/phpStudy2018/PHPTutorial/ssl/openssl.key;
ssl_session_timeout5m;
ssl_protocolsSSLv2 SSLv3 TLSv1;
ssl_ciphersHIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root html;
indexindex.html index.htm;
}
}
include vhosts.conf;
}
页:
[1]