Certbot with HTTPS is working
This commit is contained in:
@@ -8,42 +8,43 @@ upstream ghost {
|
||||
|
||||
# HTTP
|
||||
server {
|
||||
listen 8080 default_server;
|
||||
listen [::]:8080 default_server ipv6only=on;
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server ipv6only=on;
|
||||
server_name ${NGINX_HOST};
|
||||
|
||||
error_log /opt/bitnami/nginx/logs/error.log;
|
||||
access_log /opt/bitnami/nginx/logs/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
|
||||
location / {
|
||||
root /opt/bitnami/nginx/html;
|
||||
location ~ /.well-known/acme-challenge {
|
||||
allow all;
|
||||
root /var/www/html;
|
||||
}
|
||||
|
||||
rewrite ^ https://$http_host$request_uri? permanent; #Redirect traffic to HTTPS
|
||||
rewrite ^ https://$http_host$request_uri? permanent;
|
||||
|
||||
}
|
||||
|
||||
# HTTPS
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name ${NGINX_HOST};
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name ${NGINX_HOST};
|
||||
|
||||
error_log /opt/bitnami/nginx/logs/error.log;
|
||||
access_log /opt/bitnami/nginx/logs/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
ssl_session_cache shared:SSL:20m;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_ciphers "ECDH+AESGCM:ECDH+AES256:ECDH+AES128:!ADH:!AECDH:!MD5;";
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
resolver 8.8.8.8 1.1.1.1;
|
||||
ssl_certificate /etc/letsencrypt/live/${NGINX_HOST}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/${NGINX_HOST}/privkey.pem;
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/${NGINX_HOST}/chain.pem;
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
ssl_session_cache shared:SSL:20m;
|
||||
ssl_session_timeout 10m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_ciphers "ECDH+AESGCM:ECDH+AES256:ECDH+AES128:!ADH:!AECDH:!MD5;";
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
resolver 8.8.8.8 1.1.1.1;
|
||||
ssl_certificate /etc/letsencrypt/live/wolfkingdom.net/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/wolfkingdom.net/privkey.pem;
|
||||
ssl_trusted_certificate /etc/letsencrypt/live/wolfkingdom.net/chain.pem;
|
||||
|
||||
root /app;
|
||||
index index.jsp index.html index.htm;
|
||||
@@ -51,30 +52,25 @@ server {
|
||||
client_max_body_size 100M;
|
||||
|
||||
location / {
|
||||
root /opt/bitnami/nginx/html;
|
||||
}
|
||||
|
||||
location '/.well-known/acme-challenge' {
|
||||
default_type "text/plain";
|
||||
proxy_pass http://certbot_upstream;
|
||||
root /var/www/html;
|
||||
}
|
||||
|
||||
####### Proxies #######
|
||||
# PHP proxy
|
||||
# location /board {
|
||||
# fastcgi_pass php:9001;
|
||||
# fastcgi_index index.php;
|
||||
# include fastcgi.conf;
|
||||
# root /app;
|
||||
# fastcgi_pass php:9001;
|
||||
# fastcgi_index index.php;
|
||||
# include fastcgi.conf;
|
||||
# root /app;
|
||||
# }
|
||||
|
||||
location ~ \.htm$ {
|
||||
root /opt/bitnami/nginx/html;
|
||||
root /var/www/html;
|
||||
}
|
||||
|
||||
# Ghost proxy
|
||||
location /blog {
|
||||
proxy_pass http://ghost;
|
||||
proxy_pass http://ghost;
|
||||
proxy_set_header Host $http_host; # required for docker client's sake
|
||||
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -84,9 +80,9 @@ server {
|
||||
|
||||
# Tomcat proxy
|
||||
location ~ \.jsp$ {
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Server $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://tomcat;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user