How can I point http://www.domain.com ,http://domain.com ,https://domain.com to https://www.domain.com
I want to http://www.mydomain.com ,http://mydomain.com ,https://mydomain.com point to ,How]https://www.mydomain.com,[/url] How can I sent my Nginx.conf file?
No any search results
You already invited:
6 Answers
Tomas
Upvotes from: admin
```
server {
listen 80;
server_name xxx.com www.xxx.com;
return 301 https://www.xxx.com$request_uri;
}
server {
listen 443 ssl http2;
server_name xxx.com;
ssl on;
ssl_certificate fullchain.ecdsa-256.crt;
ssl_certificate_key privkey.ecdsa-256.key;
return 301 https://www.xxx.com$request_uri;
}
server {
listen 443 ssl http2;
server_name www.xxx.com;
root /xxx/www;
index index.html;
...
}
```
Tony
Upvotes from: admin
rewrite ^(.*) https://$host$1 permanent;
and,you have to ensure that you installed the ssl files in advance.
Erick
Upvotes from:
server {
listen 80;
server_name domain.com www.domain.com;
return 301 [url=https://www.domain.com]https://www.domain.com[/url]$request_uri;
}
server {
listen 443 ssl;
server_name xxx.com www.domain.com;
if ($http_host != 'www.domain.com' ) {
return 301 [url=https://www.domain.com]https://www.domain.com[/url]$request_uri;
}
}
jesse - Front end
Upvotes from:
http://nginx.org/en/docs/http/ ... .html
Ryan Haye
Upvotes from:
Dana
Upvotes from:
below server_name add your whole domain name