[code]# For more information on configuration, see:
user www-data;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
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;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
Load modular configuration files from the /etc/nginx/conf.d directory.
for more information.
include /etc/nginx/conf.d/*.conf;
###Vastspace.ca
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name vastspace.ca;
root /var/www/html/vastspace.ca;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
###Files.vastspace.ca
server {
listen 80;
listen [::]:80;
server_name files.vastspace.ca;
root /var/www/html/files.vastspace.ca;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
Settings for a TLS enabled server.
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name _;
root /var/www/html/vastspace.ca;
ssl_certificate “/etc/pki/nginx/server.crt”;
ssl_certificate_key “/etc/pki/nginx/private/server.key”;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
###Vastspace.ca
server {
server_name www.vastspace.ca vastspace.ca; # managed by Certbot
root /var/www/html/vastspace.ca;
# Load configuration files for the default server block.
#include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/vastspace.ca/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/vastspace.ca/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
}
###files.vastspace.ca
server {
server_name files.vastspace.ca; # managed by Certbot
root /var/www/html/files.vastspace.ca;
# Load configuration files for the default server block.
#include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/vastspace.ca/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/vastspace.ca/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
}
##########################################################
server {
if ($host = pixel.vastspace.ca) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = blog.vastspace.ca) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = social.vastspace.ca) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = files.vastspace.ca) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = www.vastspace.ca) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = vastspace.ca) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 ;
listen [::]:80 ;
server_name blog.vastspace.ca www.vastspace.ca social.vastspace.ca pixel.vastspace.ca files.vastspace.ca vastspace.ca;
return 404; # managed by Certbot
}}
[/code]
[code]Unit nginx.service has begun starting up.
Feb 07 01:04:28 www nginx[20856]: nginx: [emerg] duplicate listen options for [::]:443 in /etc/nginx/nginx.conf:158
Feb 07 01:04:28 www nginx[20856]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 07 01:04:28 www sudo[20843]: pam_unix(sudo:session): session closed for user root
Feb 07 01:04:28 www systemd[1]: nginx.service: control process exited, code=exited status=1
Feb 07 01:04:28 www polkitd[962]: Unregistered Authentication Agent for unix-process:20845:6419698 (system bus name :1.322, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (dis
Feb 07 01:04:28 www systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
– Subject: Unit nginx.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
– Unit nginx.service has failed.
[/code]
listen 443 ssl; # managed by Certbot
Ok, So I can get subdomains loaded on 80. It was the default server string that was messing me up but I am still having issues with SSL.