Answer the question
In order to leave comments, you need to log in
How to redirect from http:// to https:// for nginx?
How to redirect from http:// to https:// in nginx ?
Can it be done via .htaccess ?
Answer the question
In order to leave comments, you need to log in
server {
listen IP_ADDRESS;
server_name site.ru www.site.ru;
rewrite ^ https://site.ru$request_uri? permanent; #301-redirect
}
server {
listen IP_ADDRESS:443 ssl;
server_name site.ru;
root /opt/redmine/public;
passenger_enabled on;
client_max_body_size 10m; # Max attachemnt size
keepalive_timeout 60;
ssl_certificate /opt/nginx/ssl/cetr.chained.crt;
ssl_certificate_key /opt/nginx/ssl/cert.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "RC4:HIGH:!aNULL:!MD5:!kEDH";
add_header Strict-Transport-Security 'max-age=604800';
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question