Need help with Nginx SSL setup

Hello,

I am setting up a HTTPS server for the first time and I am using Nginx. I had Certbot get a cert for me and it edited the config file. Now my site (midwest.social) times out. I just wanted to test it by opening the default Nginx web page. Here is my sites-available config file:

`server {

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;

root /var/www/html;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
	server_name midwest.social; # managed by Certbot


location / {
	# First attempt to serve request as file, then
	# as directory, then fall back to displaying a 404.
	try_files $uri $uri/ =404;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
	deny all;
}


	listen [::]:443 ssl ipv6only=on; # managed by Certbot
	listen 443 ssl; # managed by Certbot
	ssl_certificate /etc/letsencrypt/live/midwest.social/fullchain.pem; # managed by Certbot
	ssl_certificate_key /etc/letsencrypt/live/midwest.social/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

}`

@porkloin
link
3
edit-2
2M

Yep, as @blank_sl8@lemmy.ml mentioned it’s very likely that you need to open port 443 on your server. Nginx is configured to listen there but your OS level config might not be allowing the traffic. Check firewalld or iptables depending on your server distro.

Edit: oops, you already solved this while I was typing 😛

@seahorse
creator
link
12M

What’s really weird is that my brother checked this earlier and it said the port was open.

@blank_sl8
link
22M

Port 443 is not open on your server.

@seahorse
creator
link
12M

Wow. I spent way too long looking into this. Thank you! I was talking to my brother and he said it was open. I see now that it was filtered so I opened it.

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

  • 0 users online
  • 26 users / day
  • 51 users / week
  • 132 users / month
  • 436 users / 6 months
  • 4014 subscribers
  • 1305 Posts
  • 3934 Comments
  • Modlog