# 不允许IP访问
server {
listen 80 default_server;
listen [::]:80 default_server;
#443必须加证书
listen 443 ssl default_server;
server_name _;
ssl_certificate /etc/nginx/cert/xxxxxx.cn.pem;
ssl_certificate_key /etc/nginx/cert/xxxxxx.cn.key;
return 403;
}
server {
listen 443 ssl;
server_name www.xxxx.cn;
add_header X-Frame-Options SAMEORIGIN;
ssl_certificate /etc/nginx/cert/xxxx.cn.pem;
ssl_certificate_key /etc/nginx/cert/xxxx.cn.key;
ssl_session_cache shared:SSL:1m;
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;
# 禁止其他网站跨域访问,设置 Referrer-Policy 头
add_header Referrer-Policy "same-origin";
# 允许访问的域名列表
server_name www.xxxx.cn xxxx.com;
location / {
root html;
index index.html index.htm;
proxy_pass http://10.10.10.10:8000;
client_max_body_size 500m;
}
@简述@绝学弃智