ZhangHuangbin wrote:It's better to show us your Nginx config file for this website. It's hard for us to help troubleshoot without it.
Ok. I didn't post it since it was the default. Here you go.
So all I want to be able to do is hit www.domain.com or domain.com and get a website. It works via http but not via https.
This is assuming that my site files would use /var/www/ as the root directory. I'd remove the index.html that does the redirect to /mail/.
Thanks
Nginx.conf.
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Hide Nginx version number
server_tokens off;
gzip on;
keepalive_timeout 600;
sendfile on;
client_max_body_size 12m;
types_hash_max_size 2048;
upstream php_workers {
server unix:/var/run/php-fpm.socket;
}
include /etc/nginx/conf.d/*.conf;
}
/etc/nginx/conf.d/00-default.conf
# HTTP
server {
# Listen on ipv4
listen 80;
# Listen on ipv6.
# Note: this setting listens on both ipv4 and ipv6 with Nginx release
# shipped in some Linux/BSD distributions.
#listen [::]:80;
server_name _;
root /var/www;
index index.php index.html;
location / {
root /var/www;
}
include /etc/nginx/templates/php-catchall.tmpl;
include /etc/nginx/templates/redirect_to_https.tmpl;
include /etc/nginx/templates/misc.tmpl;
}
# HTTPS
server {
listen 443;
server_name _;
ssl on;
ssl_certificate /etc/letsencrypt/live/mail.xxxxxxx.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mail.xxxxxxx.com/privkey.pem;
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_protocols TLSv1.2;
# Fix 'The Logjam Attack'.
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/ssl/dh2048_param.pem;
index index.php index.html;
location / {
root /var/www;
}
# HTTP Strict Transport Security (HSTS)
#include /etc/nginx/templates/hsts.tmpl;
# Web applications.
include /etc/nginx/templates/roundcube.tmpl;
include /etc/nginx/templates/iredadmin.tmpl;
include /etc/nginx/templates/sogo.tmpl;
# PHP applications. WARNING: php-catchall.tmpl should be loaded after
# other php web applications.
include /etc/nginx/templates/php-catchall.tmpl;
include /etc/nginx/templates/misc.tmpl;
}
/etc/nginx/templates/php-catchall.tmpl
# Normal PHP scripts
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass php_workers;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}