Certbot Succeeded But HTTPS Doesn't Work

Then resolve the errors man…
(Your sites-enabled vHosts probably have errors)

The only vHost in there now is the one you posted.

Please run systemctl status nginx -l and share the output.

P.S. moved to #server-config since it’s not related to certbot (certificate already obtained)

● nginx.service - nginx - high performance web server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: en
Active: failed (Result: exit-code) since Thu 2018-06-28 04:07:25 UTC; 31min a
Docs: nginx documentation
Process: 2161 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCE
Process: 2238 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited,
Main PID: 2146 (code=exited, status=0/SUCCESS)

Jun 28 04:07:25 ip-172-26-13-238 systemd[1]: Starting nginx - high performance w
Jun 28 04:07:25 ip-172-26-13-238 nginx[2238]: nginx: [emerg] "server" directive
Jun 28 04:07:25 ip-172-26-13-238 systemd[1]: nginx.service: Control process exit
Jun 28 04:07:25 ip-172-26-13-238 systemd[1]: Failed to start nginx - high perfor
Jun 28 04:07:25 ip-172-26-13-238 systemd[1]: nginx.service: Unit entered failed
Jun 28 04:07:25 ip-172-26-13-238 systemd[1]: nginx.service: Failed with result '
lines 1-14/14 (END)...skipping...
● nginx.service - nginx - high performance web server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-06-28 04:07:25 UTC; 31min ago
Docs: nginx documentation
Process: 2161 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 2238 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
Main PID: 2146 (code=exited, status=0/SUCCESS)

Jun 28 04:07:25 ip-172-26-13-238 systemd[1]: Starting nginx - high performance web server...
Jun 28 04:07:25 ip-172-26-13-238 nginx[2238]: nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/my-fathom-site:1
Jun 28 04:07:25 ip-172-26-13-238 systemd[1]: nginx.service: Control process exited, code=exited status=1
Jun 28 04:07:25 ip-172-26-13-238 systemd[1]: Failed to start nginx - high performance web server.
Jun 28 04:07:25 ip-172-26-13-238 systemd[1]: nginx.service: Unit entered failed state.
Jun 28 04:07:25 ip-172-26-13-238 systemd[1]: nginx.service: Failed with result 'exit-code'.
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~

What's the configuration now? The include needs to be inside the http section.

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;

sendfile        on;
#tcp_nopush     on;

keepalive_timeout  65;

#gzip  on;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}

I can restart Nginx now, but it doesn’t point to the right page (ardentunited.me:9000) and HTTPS doesn’t work.

Here’s the nginx -t output:

If your firewall is still wide open or DMZing to this host, then nothing’s listening on port 9000 anyway, so nothing’s going to answer. (Thus the 502 bad gateway from port 80.)

If you want it to listen HTTPS, then you have to actually listen on port 443 or some other non-HTTP port, and put in all the TLS bits and pieces. I don’t see that in your config anywhere, even if you say you added stevenzhu’s code, nginx is definitely not seeing it. You should sort out why it’s not being picked up.

I added his code back in and now I get a 404 not found on HTTPS which I believe is what should happen if I have no files there? I have Fathom running on the 9000 port.

Well you’d have to proxy_pass there, too.

Is this host still DMZ’d? If so, nothing is running on port 9000, at least visible to world+dog. Can you even connect to it locally via curl?

Try to go to ardentunited.me:9000 now

What I need to do is get Fathom https://github.com/usefathom/fathom/wiki/Installing-&-running-Fathom to serve off HTTPS so that it’s not blocked.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.