系统相关
首页 > 系统相关> > Nginx Server 配置格式

Nginx Server 配置格式

作者:互联网

server {
listen 443 ssl;
root /keeweb;
index index.html;
server_name localhost;
ssl_certificate /etc/nginx/external/cert.pem;
ssl_certificate_key /etc/nginx/external/key.pem;
server_tokens off;
add_header X-Content-Type-Options nosniff;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
ssl_dhparam /etc/nginx/external/dh.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # disable poodle
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
location / {
try_files $uri $uri/ =404;
}
location ~ /. {
deny all;
}
}

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}

server {
listen 80;
server_name yuming.com;
location ^~ / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:8081/;
}
}

标签:set,ssl,ECDH,header,server,Nginx,proxy,格式,Server
来源: https://www.cnblogs.com/zhihongli/p/13098761.html