Welcome! Log In Create A New Profile

Advanced

Nginx set via certbot is not working

Posted by Niyazi 
Nginx set via certbot is not working
February 03, 2019 04:47AM
I install Nginx with certbot lets encrypt ssl. most of the configuration done by certbot. I use https://www.ssllabs.com/ssltest/ to check my ssl and its working. I am having problem that my domain cannot make proxy pass. the sudo nginx -t working correctly.

I am new and I don't know where I am having a problem.

**The nginx nginx.conf**

user www-data;
worker_processes auto;

events {
worker_connections 1024;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
#tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 75;
types_hash_max_size 2048;
server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

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

##
# SSL Settings
##

ssl_certificate /etc/letsencrypt/live/mobile.niyazi.com/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/mobile.niyazi.com/privkey.pem;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
#ssl_stapling on;
ssl_stapling_verify on;
##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

#gzip on;

##
# Virtual Host Configs
##

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



**The nginx/conf.d/default.conf**


server {
charset UTF-8;
listen 80 ;
listen [::]:80 ;

server_name mobile.niyazi.com; # managed by Certbot

root /var/www/html;
index index.html index.htm index.nginx-debian.html;

if ($host = mobile.niyazi.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
# return 404; # managed by Certbot
}

server {
charset UTF-8;
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
server_name mobile.niyazi.com; # managed by Certbot

ssl_certificate /etc/letsencrypt/live/mobile.niyazi.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mobile.niyazi.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


location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
proxy_pass http://127.0.0.1:8888/;
}
}
Re: Nginx set via certbot is not working
February 03, 2019 05:01AM
When I test with /etc/nginx/conf.d$ curl -I mobile.niyazi.com

I get error as shown below:

curl: (7) Failed to connect to mobile.niyazi.com port 80: Connection timed out
Re: Nginx set via certbot is not working
February 03, 2019 05:06AM
Also my /etc/host shows this:
127.0.0.1 localhost
127.0.1.1 niyazi-virtual-machine

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 93
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready