Nginx/配置:修订间差异
来自康健生活
| 第41行: | 第41行: | ||
NGINX 参数详解:[http://tengine.taobao.org/nginx_docs/cn/ NGINX] | NGINX 参数详解:[http://tengine.taobao.org/nginx_docs/cn/ NGINX] | ||
== https == | |||
<syntaxhighlight lang="javascript"> | |||
server { | |||
listen 443 ssl http2; | |||
server_name www.kangjian.xyz; | |||
ssl_certificate /etc/**/**.pem; | |||
ssl_certificate_key /etc/**/**.pem; | |||
ssl_trusted_certificate /etc/**/chain.pem; | |||
add_header X-XSS-Protection "1; mode=block"; | |||
add_header X-Frame-Options SAMEORIGIN; | |||
add_header Strict-Transport-Security "max-age=15768000"; | |||
location / { | |||
root /var/www/html; | |||
} | |||
location /api { | |||
proxy_pass http://localhost:3000; | |||
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_cookie_path / "/; httponly; secure; SameSite=NONE"; | |||
} | |||
}</syntaxhighlight> | |||
== 参数 == | == 参数 == | ||
{| class="wikitable" | {| class="wikitable" | ||