I recently tried EE4 on a fresh Ubuntu 18.04 LTE. I have a wildcard SSL certificate from Comodo which I want to use, so I don’t want to use the Let’s Encrypt options. The site domain is elanders.wallmander.io and it’s a wp multisite subdir install. The http version of the site works but, not https. I’m just getting a ERR_CONNECTION_REFUSED in the browser when navigating to https://elanders.wallmander.io/
.
I went through these steps after installing EE v4:
- ee site create elanders.wallmander.io --type=wp --mu=subdir --cache
- After a successful installation (http works), I added
elanders.wallmander.io.crt
andelanders.wallmander.io.key
to/opt/easyengine/services/nginx-proxy/certs/
- I copied
/opt/easyengine/services/nginx-proxy/conf.d/default.conf
to a new conf: elanders.wallmander.io.conf - I altered elanders.wallmander.io.conf so it looks like this:
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
# scheme used to connect to this server
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
# server port the client connected to
map $http_x_forwarded_port $proxy_x_forwarded_port {
default $http_x_forwarded_port;
'' $server_port;
}
# If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any
# Connection header that may have been passed to this server
map $http_upgrade $proxy_connection {
default upgrade;
'' close;
}
# Apply fix for very long server names
server_names_hash_bucket_size 128;
# Default dhparam
ssl_dhparam /etc/nginx/dhparam/dhparam.pem;
# Set appropriate X-Forwarded-Ssl header
map $scheme $proxy_x_forwarded_ssl {
default off;
https on;
}
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
log_format vhost '$host $remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log off;
error_log /dev/stderr;
resolver 127.0.0.11;
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
proxy_set_header X-Original-URI $request_uri;
# Mitigate httpoxy attack (see README for details)
proxy_set_header Proxy "";
server {
server_name _; # This is just an invalid value which will never trigger on a real hostname.
listen 80;
access_log /var/log/nginx/access.log vhost;
return 503;
}
# elanders.wallmander.io/
upstream elanders.wallmander.io-42099b4af021e53fd8fd4e056c2568d7c2e3ffa8 {
# Cannot connect to network of this container
server 127.0.0.1 down;
## Can be connected with "ee-global-frontend-network" network
# elanderswallmanderio_nginx_1
server 172.19.0.3:80;
# Cannot connect to network of this container
server 127.0.0.1 down;
}
server {
server_name elanders.wallmander.io;
listen 443 ;
access_log /var/log/nginx/access.log vhost;
server_name elanders.wallmander.io;
ssl on;
ssl_certificate /opt/easyengine/services/nginx-proxy/certs/elanders.wallmander.io.crt;
ssl_certificate_key /opt/easyengine/services/nginx-proxy/certs/elanders.wallmander.io.key;
location / {
proxy_pass https://elanders.wallmander.io-42099b4af021e53fd8fd4e056c2568d7c2e3ffa8/;
}
location /ee-admin/ {
proxy_pass http://elanders.wallmander.io-42099b4af021e53fd8fd4e056c2568d7c2e3ffa8;
auth_basic "Restricted elanders.wallmander.io Admin Tools";
auth_basic_user_file /etc/nginx/htpasswd/default_admin_tools;
include /etc/nginx/vhost.d/default_acl;
}
}
ee site reload elanders.wallmander.io
ee service restart nginx-proxy
The result is that both the http and https URL:s show ERR_CONNECTION_REFUSED
What am I doing wrong? I couldn’t find a guide for configuring v4 for a custom SSL so I just made a wild guess how to do it.