Update zammad_ssl.conf
This commit is contained in:
parent
8af6e2b9eb
commit
0a619bc3f7
1 changed files with 70 additions and 109 deletions
|
@ -1,13 +1,14 @@
|
||||||
#
|
#
|
||||||
# this is an example nginx config for zammad with free letsencrypt.org ssl certificates
|
# this is an example nginx config for using SSL with zammad
|
||||||
|
# this can be adjusted to be used with self-signed, trusted ca, and letsencrypt certs
|
||||||
# replace all occurrences of example.com with your domain
|
# replace all occurrences of example.com with your domain
|
||||||
# create letsencrypt certificate by: certbot certonly --webroot -w /var/www/html -d www.example.com
|
# If using LetsEncrypt create letsencrypt certificate by: certbot certonly --webroot -w /var/www/html -d www.example.com
|
||||||
# create dhparam.pem by: openssl dhparam -out /etc/nginx/ssl/dhparam.pem 4096
|
# create dhparam.pem by: openssl dhparam -out /etc/nginx/ssl/dhparam.pem 4096
|
||||||
# download x3 certificate by: wget -q https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem -P /etc/nginx/ssl
|
# download LetsEncrypt x3 certificate by: wget -q https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem -P /etc/nginx/ssl
|
||||||
# you can test your ssl configuration @ https://www.ssllabs.com/ssltest/analyze.html
|
# you can test your ssl configuration @ https://www.ssllabs.com/ssltest/analyze.html
|
||||||
#
|
#
|
||||||
|
|
||||||
upstream zammad {
|
upstream zammad-railsserver {
|
||||||
server localhost:3000;
|
server localhost:3000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,35 +18,33 @@ upstream zammad-websocket {
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name example.com www.example.com;
|
server_name example.com www.example.com;
|
||||||
|
|
||||||
access_log /var/log/nginx/example.com.access.log;
|
access_log /var/log/nginx/zammad.access.log;
|
||||||
error_log /var/log/nginx/example.com.error.log;
|
error_log /var/log/nginx/zammad.error.log;
|
||||||
|
|
||||||
location /.well-known/ {
|
location /.well-known/ {
|
||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
rewrite ^/(.*)$ https://www.example.com/$1 permanent;
|
rewrite ^/(.*)$ https://example.com/$1 permanent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 443 ssl http2;
|
listen 443 ssl http2;
|
||||||
listen [::]:443 ssl http2;
|
|
||||||
|
|
||||||
server_name example.com;
|
server_name example.com;
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/ssl/example.com-fullchain.pem;
|
ssl_certificate /etc/nginx/ssl/your_cert.crt;
|
||||||
ssl_certificate_key /etc/nginx/ssl/example.com-privkey.pem;
|
ssl_certificate_key /etc/nginx/ssl/your_private_key.key;
|
||||||
|
|
||||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
ssl_protocols TLSv1.2;
|
||||||
|
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
|
||||||
|
|
||||||
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
|
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
|
||||||
|
|
||||||
|
@ -57,42 +56,7 @@ server {
|
||||||
ssl_stapling on;
|
ssl_stapling on;
|
||||||
ssl_stapling_verify on;
|
ssl_stapling_verify on;
|
||||||
|
|
||||||
ssl_trusted_certificate /etc/nginx/ssl/lets-encrypt-x3-cross-signed.pem;
|
ssl_trusted_certificate /etc/nginx/ssl/your_cert.crt;
|
||||||
|
|
||||||
resolver 8.8.8.8 8.8.4.4;
|
|
||||||
|
|
||||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
|
||||||
|
|
||||||
access_log /var/log/nginx/example.com.access.log;
|
|
||||||
error_log /var/log/nginx/example.com.error.log;
|
|
||||||
|
|
||||||
rewrite ^/(.*)$ https://www.example.com/$1 permanent;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 ssl http2;
|
|
||||||
listen [::]:443 ssl http2;
|
|
||||||
|
|
||||||
server_name www.example.com;
|
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/ssl/example.com-fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/nginx/ssl/example.com-privkey.pem;
|
|
||||||
|
|
||||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
||||||
|
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
||||||
|
|
||||||
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
|
|
||||||
|
|
||||||
ssl_prefer_server_ciphers on;
|
|
||||||
|
|
||||||
ssl_session_cache shared:SSL:10m;
|
|
||||||
ssl_session_timeout 180m;
|
|
||||||
|
|
||||||
ssl_stapling on;
|
|
||||||
ssl_stapling_verify on;
|
|
||||||
|
|
||||||
ssl_trusted_certificate /etc/nginx/ssl/lets-encrypt-x3-cross-signed.pem;
|
|
||||||
|
|
||||||
resolver 8.8.8.8 8.8.4.4;
|
resolver 8.8.8.8 8.8.4.4;
|
||||||
|
|
||||||
|
@ -108,8 +72,8 @@ server {
|
||||||
|
|
||||||
root /opt/zammad/public;
|
root /opt/zammad/public;
|
||||||
|
|
||||||
access_log /var/log/nginx/example.com.access.log;
|
access_log /var/log/nginx/zammad.access.log;
|
||||||
error_log /var/log/nginx/example.com.error.log;
|
error_log /var/log/nginx/zammad.error.log;
|
||||||
|
|
||||||
client_max_body_size 50M;
|
client_max_body_size 50M;
|
||||||
|
|
||||||
|
@ -123,18 +87,15 @@ server {
|
||||||
proxy_set_header Connection "Upgrade";
|
proxy_set_header Connection "Upgrade";
|
||||||
proxy_set_header CLIENT_IP $remote_addr;
|
proxy_set_header CLIENT_IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_read_timeout 86400;
|
proxy_read_timeout 86400;
|
||||||
proxy_pass http://zammad-websocket;
|
proxy_pass http://zammad-websocket;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header CLIENT_IP $remote_addr;
|
proxy_set_header CLIENT_IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_read_timeout 180;
|
||||||
proxy_read_timeout 300;
|
proxy_pass http://zammad-railsserver;
|
||||||
proxy_pass http://zammad;
|
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_types text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml;
|
gzip_types text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml;
|
||||||
|
|
Loading…
Reference in a new issue