Why is www.domain.com not redirecting to domain.com?Nginx has ssl module, but thinks it doesn'tCan not change nginx 1.2.5 default websitenginx ssl proxy for one hostname onlyNginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx PHP files downloading instead of executingCodeIgniter nginx rewrite rules for i8ln URL'sHow to serve Autodiscover.xml using NginxConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsWhy Nginx calls for invalid certificate in non-existent subdomains just to redirect to 404?Nginx reverse proxy to many local servers + webserver duty
Why was this character made Grand Maester?
Python script to extract text from PDF with images
Did Game of Thrones end the way that George RR Martin intended?
Was this scene in S8E06 added because of fan reactions to S8E04?
Using too much dialogue?
Is superuser the same as root?
Fill area of x^2+y^2>1 and x^2+y^2>4 using patterns and tikzpicture
Toxic, harassing lab environment
How does the Earth's center produce heat?
How do you earn the reader's trust?
Why do the i8080 I/O instructions take a byte-sized operand to determine the port?
How did the Allies achieve air superiority on Sicily?
Piping the output of comand columns
Flatten not working
Could a rotating ring space station have a bolo-like extension?
Moons and messages
Cisco 3750X Power Cable
Why is the Eisenstein ideal paper so great?
Is it safe to redirect stdout and stderr to the same file without file descriptor copies?
Status of proof by contradiction and excluded middle throughout the history of mathematics?
Why is 'additive' EQ more difficult to use than 'subtractive'?
What is the purpose of the yellow wired panels on the IBM 360 Model 20?
Are runways booked by airlines to land their planes?
EU rights when flight delayed so much that return is missed
Why is www.domain.com not redirecting to domain.com?
Nginx has ssl module, but thinks it doesn'tCan not change nginx 1.2.5 default websitenginx ssl proxy for one hostname onlyNginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx PHP files downloading instead of executingCodeIgniter nginx rewrite rules for i8ln URL'sHow to serve Autodiscover.xml using NginxConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsWhy Nginx calls for invalid certificate in non-existent subdomains just to redirect to 404?Nginx reverse proxy to many local servers + webserver duty
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I want www.lizardgizzards.com to redirect to https://lizardgizzards.com
But instead it redirects to https://www.lizardgizzards.com
Here's my redirect config:
server
listen 80;
listen [::]:80;
server_name lizardgizzards.com www.lizardgizzards.com;
if ($host = 'www.lizardgizzards.com')
return 301 https://lizardgizzards.com;
if ($host = 'lizardgizzards.com')
return 301 https://$host$request_uri;
my SSL config:
server
root /var/www/html/lizardgizzards.com;
index index.html index.htm index.nginx-debian.html;
server_name lizardgizzards.com;
location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
listen [::]:443 ssl ipv6only=on default_server; # managed by Certbot
listen 443 ssl default_server; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/lizardgizzards.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/lizardgizzards.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
It seems to be working with the dig command:
ubuntu@mars:/var/www/html$ curl -I www.lizardgizzards.com
HTTP/1.1 301 Moved Permanently
Server: nginx/1.14.0 (Ubuntu)
Date: Thu, 09 May 2019 03:52:45 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: http://lizardgizzards.com
But my browser doesn't seem to get the memo. Even in an incognito window it goes to the wrong URL: https://www.lizardgizzards.com
nginx
add a comment |
I want www.lizardgizzards.com to redirect to https://lizardgizzards.com
But instead it redirects to https://www.lizardgizzards.com
Here's my redirect config:
server
listen 80;
listen [::]:80;
server_name lizardgizzards.com www.lizardgizzards.com;
if ($host = 'www.lizardgizzards.com')
return 301 https://lizardgizzards.com;
if ($host = 'lizardgizzards.com')
return 301 https://$host$request_uri;
my SSL config:
server
root /var/www/html/lizardgizzards.com;
index index.html index.htm index.nginx-debian.html;
server_name lizardgizzards.com;
location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
listen [::]:443 ssl ipv6only=on default_server; # managed by Certbot
listen 443 ssl default_server; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/lizardgizzards.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/lizardgizzards.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
It seems to be working with the dig command:
ubuntu@mars:/var/www/html$ curl -I www.lizardgizzards.com
HTTP/1.1 301 Moved Permanently
Server: nginx/1.14.0 (Ubuntu)
Date: Thu, 09 May 2019 03:52:45 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: http://lizardgizzards.com
But my browser doesn't seem to get the memo. Even in an incognito window it goes to the wrong URL: https://www.lizardgizzards.com
nginx
add a comment |
I want www.lizardgizzards.com to redirect to https://lizardgizzards.com
But instead it redirects to https://www.lizardgizzards.com
Here's my redirect config:
server
listen 80;
listen [::]:80;
server_name lizardgizzards.com www.lizardgizzards.com;
if ($host = 'www.lizardgizzards.com')
return 301 https://lizardgizzards.com;
if ($host = 'lizardgizzards.com')
return 301 https://$host$request_uri;
my SSL config:
server
root /var/www/html/lizardgizzards.com;
index index.html index.htm index.nginx-debian.html;
server_name lizardgizzards.com;
location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
listen [::]:443 ssl ipv6only=on default_server; # managed by Certbot
listen 443 ssl default_server; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/lizardgizzards.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/lizardgizzards.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
It seems to be working with the dig command:
ubuntu@mars:/var/www/html$ curl -I www.lizardgizzards.com
HTTP/1.1 301 Moved Permanently
Server: nginx/1.14.0 (Ubuntu)
Date: Thu, 09 May 2019 03:52:45 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: http://lizardgizzards.com
But my browser doesn't seem to get the memo. Even in an incognito window it goes to the wrong URL: https://www.lizardgizzards.com
nginx
I want www.lizardgizzards.com to redirect to https://lizardgizzards.com
But instead it redirects to https://www.lizardgizzards.com
Here's my redirect config:
server
listen 80;
listen [::]:80;
server_name lizardgizzards.com www.lizardgizzards.com;
if ($host = 'www.lizardgizzards.com')
return 301 https://lizardgizzards.com;
if ($host = 'lizardgizzards.com')
return 301 https://$host$request_uri;
my SSL config:
server
root /var/www/html/lizardgizzards.com;
index index.html index.htm index.nginx-debian.html;
server_name lizardgizzards.com;
location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
listen [::]:443 ssl ipv6only=on default_server; # managed by Certbot
listen 443 ssl default_server; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/lizardgizzards.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/lizardgizzards.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
It seems to be working with the dig command:
ubuntu@mars:/var/www/html$ curl -I www.lizardgizzards.com
HTTP/1.1 301 Moved Permanently
Server: nginx/1.14.0 (Ubuntu)
Date: Thu, 09 May 2019 03:52:45 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: http://lizardgizzards.com
But my browser doesn't seem to get the memo. Even in an incognito window it goes to the wrong URL: https://www.lizardgizzards.com
nginx
nginx
asked May 9 at 3:50
Blaine LafreniereBlaine Lafreniere
18029
18029
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
So the problem was that I had previously accepted a security exception in Chrome for an invalid certificate...
In Chrome I opted to re-enable SSL warnings and now the redirect is working properly.
you don't have any redirects configured in your ssl configuration.
– Gerald Schneider
May 9 at 6:53
add a comment |
Check your browsers network tab in the developer bar (in Chrome or Firefox press [F12], in Safari use [ALT][CMD][i] and change to network). Activate "Preserve log" and "Disable cache" for better results.
Start browsing your desired URL again and watch the things your browser is doing.
I assume that you will see a redirect 307 from your http to your https location. This means, that your browser will use an internal redirect. Instead of accessing the server and handling the server's response, your browser has an internal list of sites supporting the https protocol. Instead of using http it will redirect requests of these sites internally to https.
Such sites have sent the HSTS header to inform browsers about the preference of using https. This header is sent with a validity in seconds. Actually its pretty hard to remove this preference from browsers once sent.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f966489%2fwhy-is-www-domain-com-not-redirecting-to-domain-com%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
So the problem was that I had previously accepted a security exception in Chrome for an invalid certificate...
In Chrome I opted to re-enable SSL warnings and now the redirect is working properly.
you don't have any redirects configured in your ssl configuration.
– Gerald Schneider
May 9 at 6:53
add a comment |
So the problem was that I had previously accepted a security exception in Chrome for an invalid certificate...
In Chrome I opted to re-enable SSL warnings and now the redirect is working properly.
you don't have any redirects configured in your ssl configuration.
– Gerald Schneider
May 9 at 6:53
add a comment |
So the problem was that I had previously accepted a security exception in Chrome for an invalid certificate...
In Chrome I opted to re-enable SSL warnings and now the redirect is working properly.
So the problem was that I had previously accepted a security exception in Chrome for an invalid certificate...
In Chrome I opted to re-enable SSL warnings and now the redirect is working properly.
answered May 9 at 3:59
Blaine LafreniereBlaine Lafreniere
18029
18029
you don't have any redirects configured in your ssl configuration.
– Gerald Schneider
May 9 at 6:53
add a comment |
you don't have any redirects configured in your ssl configuration.
– Gerald Schneider
May 9 at 6:53
you don't have any redirects configured in your ssl configuration.
– Gerald Schneider
May 9 at 6:53
you don't have any redirects configured in your ssl configuration.
– Gerald Schneider
May 9 at 6:53
add a comment |
Check your browsers network tab in the developer bar (in Chrome or Firefox press [F12], in Safari use [ALT][CMD][i] and change to network). Activate "Preserve log" and "Disable cache" for better results.
Start browsing your desired URL again and watch the things your browser is doing.
I assume that you will see a redirect 307 from your http to your https location. This means, that your browser will use an internal redirect. Instead of accessing the server and handling the server's response, your browser has an internal list of sites supporting the https protocol. Instead of using http it will redirect requests of these sites internally to https.
Such sites have sent the HSTS header to inform browsers about the preference of using https. This header is sent with a validity in seconds. Actually its pretty hard to remove this preference from browsers once sent.
add a comment |
Check your browsers network tab in the developer bar (in Chrome or Firefox press [F12], in Safari use [ALT][CMD][i] and change to network). Activate "Preserve log" and "Disable cache" for better results.
Start browsing your desired URL again and watch the things your browser is doing.
I assume that you will see a redirect 307 from your http to your https location. This means, that your browser will use an internal redirect. Instead of accessing the server and handling the server's response, your browser has an internal list of sites supporting the https protocol. Instead of using http it will redirect requests of these sites internally to https.
Such sites have sent the HSTS header to inform browsers about the preference of using https. This header is sent with a validity in seconds. Actually its pretty hard to remove this preference from browsers once sent.
add a comment |
Check your browsers network tab in the developer bar (in Chrome or Firefox press [F12], in Safari use [ALT][CMD][i] and change to network). Activate "Preserve log" and "Disable cache" for better results.
Start browsing your desired URL again and watch the things your browser is doing.
I assume that you will see a redirect 307 from your http to your https location. This means, that your browser will use an internal redirect. Instead of accessing the server and handling the server's response, your browser has an internal list of sites supporting the https protocol. Instead of using http it will redirect requests of these sites internally to https.
Such sites have sent the HSTS header to inform browsers about the preference of using https. This header is sent with a validity in seconds. Actually its pretty hard to remove this preference from browsers once sent.
Check your browsers network tab in the developer bar (in Chrome or Firefox press [F12], in Safari use [ALT][CMD][i] and change to network). Activate "Preserve log" and "Disable cache" for better results.
Start browsing your desired URL again and watch the things your browser is doing.
I assume that you will see a redirect 307 from your http to your https location. This means, that your browser will use an internal redirect. Instead of accessing the server and handling the server's response, your browser has an internal list of sites supporting the https protocol. Instead of using http it will redirect requests of these sites internally to https.
Such sites have sent the HSTS header to inform browsers about the preference of using https. This header is sent with a validity in seconds. Actually its pretty hard to remove this preference from browsers once sent.
answered May 11 at 15:45
Jens BradlerJens Bradler
3,87121313
3,87121313
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f966489%2fwhy-is-www-domain-com-not-redirecting-to-domain-com%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown