5344
5432
1万
管理员
本站资源如失效,请点击反馈!
hello world
GET /index.html HTTP/1.1
GET /style.css HTTP/1.1
GET /example.png HTTP/1.1
$ cd nginx-docker-demo$ rm html/index.html
h1 { color: red;}
server { listen 443 ssl http2; server_name localhost; ssl on; ssl_certificate /etc/nginx/certs/example.crt; ssl_certificate_key /etc/nginx/certs/example.key; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location / { root /usr/share/nginx/html; index index.html index.htm; http2_push /style.css; http2_push /example.png; }}
$ docker container run \ --rm \ --name mynginx \ --volume "$PWD/html":/usr/share/nginx/html \ --volume "$PWD/conf":/etc/nginx \ -p 127.0.0.2:8080:80 \ -p 127.0.0.2:8081:443 \ -d \ nginx
$ docker container stop mynginx
Header add Link "; rel=preload; as=style" Header add Link "; rel=preload; as=image"
Link: ; rel=preload; as=style
Link: ; rel=preload; as=style, ; rel=preload; as=image
server { listen 443 ssl http2; # ... root /var/www/html; location = / { proxy_pass http://upstream; http2_push_preload on; }}
server { listen 443 ssl http2 default_server; ssl_certificate ssl/certificate.pem; ssl_certificate_key ssl/key.pem; root /var/www/html; http2_push_preload on; location = /demo.html { add_header Set-Cookie "session=1"; add_header Link $resources; }}map $http_cookie $resources { "~*session=1" ""; default "; as=style; rel=preload";}
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
手机版|飞雪团队
GMT+8, 2024-11-24 05:29 , Processed in 0.094145 second(s), 24 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.