ssl - Nginx redirect http to https not working -



ssl - Nginx redirect http to https not working -

i'm setting nginx server ssl.

the domain ssl dev.cooknconnect.com want redirect requests from: http://domain.com https://domain.com have next server blocks setup currently:

server { hear 1.2.3.4:80 default; server_name domain.com; server_tokens off; rewrite ^ https://$server_name$request_uri? permanent; } server { hear 443 ssl; server_name domain.com www.domain.com; keepalive_timeout 70; server_tokens off; ssl on; ssl_certificate /etc/ssl/certs/certificate.crt; ssl_certificate_key /etc/ssl/private/certificate.key; ssl_session_timeout 5m; ssl_protocols sslv3 tlsv1; ssl_ciphers all:!adh:!export56:rc4+rsa:+high:+medium:+low:+sslv3:+exp; ssl_prefer_server_ciphers on; location / { proxy_pass http://domain.com; } }

this not work, don't understand why not.can find error in config.if not please suggest way track or debugging same.

you utilize , should work normally

server { hear 80; server_name domain.com; server_tokens off; homecoming 301 https://$http_host$request_uri; }

keep in mind https://dev.yourdomain.com won't work, because certificate issued root domain, https dev subdomain show yellowish certificate warning.

ssl nginx

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -