nginx配置
worker_processes 1
;
events
{
worker_connections 1024
;
}
http
{
include mime.types
;
default_type application/octet-stream
;
sendfile on
;
keepalive_timeout 65
;
limit_req_zone
$server_name zone
=one:1m rate
=100r/s
;
limit_req_zone
$binary_remote_addr zone
=two:2m rate
=1r/s
;
limit_conn_zone
$binary_remote_addr zone
=four:2m
;
server
{
listen x
;
server_name localhost
;
location /
{
root /usr/local/nginx/项目名称(这一级有html)
;
index index.html index.htm
;
}
}
server
{
listen 443 ssl
;
server_name xxxx.xxx
;
ssl_certificate xxxxxx.crt
;
ssl_certificate_key xxxxxx.key
;
ssl_session_timeout 5m
;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:
!NULL:
!aNULL:
!MD5:
!ADH:
!RC4
;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2
;
ssl_prefer_server_ciphers on
;
location /
{
proxy_buffer_size 128k
;
proxy_buffers 32 32k
;
proxy_busy_buffers_size 128k
;
proxy_pass http://127.0.0.1:xxxx
;
limit_req zone
=one burst
=3000 nodelay
;
limit_req zone
=two burst
=50 nodelay
;
limit_conn four 10
;
limit_rate 1m
;
}
}
server
{
listen 80
;
server_name xxxx.xx
;
return 301 https://
$host$request_uri;
}
}
nginx中配置访问防火墙
可参考https://blog.csdn.net/keketrtr/article/details/75315330