NGINX 443 is not binding but 80 redirects to https from the same file
I have been trying to configure a config which I believe to have been working on another server for static HTML serving. When I run NGINX it binds on port 80, yet does not show port 443 is being used.
The console does not show any noticeable errors and a config test does return a valid 'nginx.conf'
The layout i'm using in the other server is the same layout followed here
/etc/nginx/conf.d/www.redacted.tk.conf
server {
listen 443;
listen [::]:443;
server_name www.redacted.tk;
# SSL
ssl on;
ssl_certificate /etc/letsencrypt/live/www.redacted.tk/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.redacted.tk/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/www.redacted.tk/fullchain.pem;
# root directory (checked and does exist in /bin/bash on container)
root /local/redacted/www-portfolio;
# display html
location / {
try_files /index.html $uri $uri/ =404;
include /etc/nginx/nginxconfig.io/proxy.conf;
}
}
# HTTP redirect
server {
listen 80;
listen [::]:80;
server_name www.redacted.tk;
location / {
return 301 https://www.redacted.tk$request_uri;
}
}
Edit
I figured I should mention that when I check with netstat, it does not show 443 is bound. However it does show that 80 is bound and http://www.redacted.tk does redirect to https://www.redacted.tk which is refused.
Edit
Attempted to move flags around such as SSL back into the listen directive as a comment suggested. NGINX 1.15.5 is my current version.
nginx web-hosting
add a comment |
I have been trying to configure a config which I believe to have been working on another server for static HTML serving. When I run NGINX it binds on port 80, yet does not show port 443 is being used.
The console does not show any noticeable errors and a config test does return a valid 'nginx.conf'
The layout i'm using in the other server is the same layout followed here
/etc/nginx/conf.d/www.redacted.tk.conf
server {
listen 443;
listen [::]:443;
server_name www.redacted.tk;
# SSL
ssl on;
ssl_certificate /etc/letsencrypt/live/www.redacted.tk/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.redacted.tk/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/www.redacted.tk/fullchain.pem;
# root directory (checked and does exist in /bin/bash on container)
root /local/redacted/www-portfolio;
# display html
location / {
try_files /index.html $uri $uri/ =404;
include /etc/nginx/nginxconfig.io/proxy.conf;
}
}
# HTTP redirect
server {
listen 80;
listen [::]:80;
server_name www.redacted.tk;
location / {
return 301 https://www.redacted.tk$request_uri;
}
}
Edit
I figured I should mention that when I check with netstat, it does not show 443 is bound. However it does show that 80 is bound and http://www.redacted.tk does redirect to https://www.redacted.tk which is refused.
Edit
Attempted to move flags around such as SSL back into the listen directive as a comment suggested. NGINX 1.15.5 is my current version.
nginx web-hosting
what version of nginx are you using? I believe the preferred syntax islisten 443 ssl;
now
– William Chong
Nov 21 '18 at 20:21
I am using 1.15.5 - however I had it aslisten 443 ssl http2;
and it made no difference. I will try that now and let you know how it goes though. That did not make a difference. It still just redirects to https but https is refused. @WilliamChong
– sammyvsparks
Nov 21 '18 at 20:28
add a comment |
I have been trying to configure a config which I believe to have been working on another server for static HTML serving. When I run NGINX it binds on port 80, yet does not show port 443 is being used.
The console does not show any noticeable errors and a config test does return a valid 'nginx.conf'
The layout i'm using in the other server is the same layout followed here
/etc/nginx/conf.d/www.redacted.tk.conf
server {
listen 443;
listen [::]:443;
server_name www.redacted.tk;
# SSL
ssl on;
ssl_certificate /etc/letsencrypt/live/www.redacted.tk/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.redacted.tk/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/www.redacted.tk/fullchain.pem;
# root directory (checked and does exist in /bin/bash on container)
root /local/redacted/www-portfolio;
# display html
location / {
try_files /index.html $uri $uri/ =404;
include /etc/nginx/nginxconfig.io/proxy.conf;
}
}
# HTTP redirect
server {
listen 80;
listen [::]:80;
server_name www.redacted.tk;
location / {
return 301 https://www.redacted.tk$request_uri;
}
}
Edit
I figured I should mention that when I check with netstat, it does not show 443 is bound. However it does show that 80 is bound and http://www.redacted.tk does redirect to https://www.redacted.tk which is refused.
Edit
Attempted to move flags around such as SSL back into the listen directive as a comment suggested. NGINX 1.15.5 is my current version.
nginx web-hosting
I have been trying to configure a config which I believe to have been working on another server for static HTML serving. When I run NGINX it binds on port 80, yet does not show port 443 is being used.
The console does not show any noticeable errors and a config test does return a valid 'nginx.conf'
The layout i'm using in the other server is the same layout followed here
/etc/nginx/conf.d/www.redacted.tk.conf
server {
listen 443;
listen [::]:443;
server_name www.redacted.tk;
# SSL
ssl on;
ssl_certificate /etc/letsencrypt/live/www.redacted.tk/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.redacted.tk/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/www.redacted.tk/fullchain.pem;
# root directory (checked and does exist in /bin/bash on container)
root /local/redacted/www-portfolio;
# display html
location / {
try_files /index.html $uri $uri/ =404;
include /etc/nginx/nginxconfig.io/proxy.conf;
}
}
# HTTP redirect
server {
listen 80;
listen [::]:80;
server_name www.redacted.tk;
location / {
return 301 https://www.redacted.tk$request_uri;
}
}
Edit
I figured I should mention that when I check with netstat, it does not show 443 is bound. However it does show that 80 is bound and http://www.redacted.tk does redirect to https://www.redacted.tk which is refused.
Edit
Attempted to move flags around such as SSL back into the listen directive as a comment suggested. NGINX 1.15.5 is my current version.
nginx web-hosting
nginx web-hosting
edited Nov 21 '18 at 21:47
sammyvsparks
asked Nov 21 '18 at 20:06
sammyvsparkssammyvsparks
11
11
what version of nginx are you using? I believe the preferred syntax islisten 443 ssl;
now
– William Chong
Nov 21 '18 at 20:21
I am using 1.15.5 - however I had it aslisten 443 ssl http2;
and it made no difference. I will try that now and let you know how it goes though. That did not make a difference. It still just redirects to https but https is refused. @WilliamChong
– sammyvsparks
Nov 21 '18 at 20:28
add a comment |
what version of nginx are you using? I believe the preferred syntax islisten 443 ssl;
now
– William Chong
Nov 21 '18 at 20:21
I am using 1.15.5 - however I had it aslisten 443 ssl http2;
and it made no difference. I will try that now and let you know how it goes though. That did not make a difference. It still just redirects to https but https is refused. @WilliamChong
– sammyvsparks
Nov 21 '18 at 20:28
what version of nginx are you using? I believe the preferred syntax is
listen 443 ssl;
now– William Chong
Nov 21 '18 at 20:21
what version of nginx are you using? I believe the preferred syntax is
listen 443 ssl;
now– William Chong
Nov 21 '18 at 20:21
I am using 1.15.5 - however I had it as
listen 443 ssl http2;
and it made no difference. I will try that now and let you know how it goes though. That did not make a difference. It still just redirects to https but https is refused. @WilliamChong– sammyvsparks
Nov 21 '18 at 20:28
I am using 1.15.5 - however I had it as
listen 443 ssl http2;
and it made no difference. I will try that now and let you know how it goes though. That did not make a difference. It still just redirects to https but https is refused. @WilliamChong– sammyvsparks
Nov 21 '18 at 20:28
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
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%2fstackoverflow.com%2fquestions%2f53419740%2fnginx-443-is-not-binding-but-80-redirects-to-https-from-the-same-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- 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%2fstackoverflow.com%2fquestions%2f53419740%2fnginx-443-is-not-binding-but-80-redirects-to-https-from-the-same-file%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
what version of nginx are you using? I believe the preferred syntax is
listen 443 ssl;
now– William Chong
Nov 21 '18 at 20:21
I am using 1.15.5 - however I had it as
listen 443 ssl http2;
and it made no difference. I will try that now and let you know how it goes though. That did not make a difference. It still just redirects to https but https is refused. @WilliamChong– sammyvsparks
Nov 21 '18 at 20:28