0
您好,我已在(站點已啓用)文件夾下面的nginx配置,我想爲我的angularjs應用程序添加一些prerender.io配置,但它似乎不起作用。使用nginx和ssl配置prerender.io
我認爲,在這裏我們需要配置預配器以良好的ssl。
server {
listen 443;
listen [::]:443 ssl;
server_name www.test.com test.com;
server_tokens off;
if ($host = 'test.com') {
return 301 https://www.test.com$request_uri;
}
root /home/test/public;
ssl on;
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:30m;
ssl_session_timeout 1d;
ssl_session_tickets off;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA';
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4;
location/{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
add_header Strict-Transport-Security "max-age=31536000;
includeSubDomains" always;
proxy_pass http://127.0.0.1:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
server_tokens off;
}
}
server {
listen 80;
listen [::]:80;
server_name www.test.com test.com;
return 301 https://www.test.com$request_uri;
}
你看過prerender的nginx配置嗎? https://gist.github.com/thoop/8165802 – mcranston18
嗨mcranston18謝謝你的回覆,但實際上我試過但沒有成功!爲此我要求 –
你是什麼意思不起作用?你需要解釋錯誤 –