made examples ssl config mor letsencrypt specific
This commit is contained in:
parent
ef8e08b270
commit
1912e56534
1 changed files with 34 additions and 33 deletions
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# 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
|
||||
# this can be adjusted to be used with self-signed, trusted ca and letsencrypt certs
|
||||
# this example uses letsencrypt certs. replace all occurrences of example.com with your domain
|
||||
# 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
|
||||
# download LetsEncrypt x3 certificate by: wget -q https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem -P /etc/nginx/ssl
|
||||
|
@ -19,7 +19,7 @@ upstream zammad-websocket {
|
|||
server {
|
||||
listen 80;
|
||||
|
||||
server_name example.com www.example.com;
|
||||
server_name example.com;
|
||||
|
||||
access_log /var/log/nginx/zammad.access.log;
|
||||
error_log /var/log/nginx/zammad.error.log;
|
||||
|
@ -39,8 +39,8 @@ server {
|
|||
|
||||
server_name example.com;
|
||||
|
||||
ssl_certificate /etc/nginx/ssl/your_cert.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/your_private_key.key;
|
||||
ssl_certificate /etc/nginx/ssl/example.com-fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/example.com-privkey.pem;
|
||||
|
||||
ssl_protocols TLSv1.2;
|
||||
|
||||
|
@ -62,40 +62,41 @@ server {
|
|||
|
||||
add_header Strict-Transport-Security "max-age=31536000" always;
|
||||
|
||||
location = /robots.txt {
|
||||
access_log off; log_not_found off;
|
||||
}
|
||||
location = /robots.txt {
|
||||
access_log off; log_not_found off;
|
||||
}
|
||||
|
||||
location = /favicon.ico {
|
||||
access_log off; log_not_found off;
|
||||
}
|
||||
location = /favicon.ico {
|
||||
access_log off; log_not_found off;
|
||||
}
|
||||
|
||||
root /opt/zammad/public;
|
||||
root /opt/zammad/public;
|
||||
|
||||
access_log /var/log/nginx/zammad.access.log;
|
||||
error_log /var/log/nginx/zammad.error.log;
|
||||
access_log /var/log/nginx/zammad.access.log;
|
||||
error_log /var/log/nginx/zammad.error.log;
|
||||
|
||||
client_max_body_size 50M;
|
||||
client_max_body_size 50M;
|
||||
|
||||
location ~ ^/(assets/|robots.txt|humans.txt|favicon.ico) {
|
||||
expires max;
|
||||
}
|
||||
location ~ ^/(assets/|robots.txt|humans.txt|favicon.ico) {
|
||||
expires max;
|
||||
}
|
||||
|
||||
location /ws {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header CLIENT_IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 86400;
|
||||
proxy_pass http://zammad-websocket;
|
||||
}
|
||||
location / {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header CLIENT_IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 180;
|
||||
proxy_pass http://zammad-railsserver;
|
||||
location /ws {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header CLIENT_IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 86400;
|
||||
proxy_pass http://zammad-websocket;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header CLIENT_IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 180;
|
||||
proxy_pass http://zammad-railsserver;
|
||||
|
||||
gzip on;
|
||||
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