Add certbot. Fix nginx config.

This commit is contained in:
RealStickman 2021-05-17 20:35:50 +02:00
parent 339e39a263
commit acd3f56e4d

View File

@ -71,7 +71,7 @@ Copy `service_discovery_blacklist` or `service_discovery_whitelist` to `/etc/zab
`# systemctl restart zabbix-agent` `# systemctl restart zabbix-agent`
Install proxy in front of zabbix Install proxy in front of zabbix
`# apt install nginx` `# apt install nginx certbot python3-certbot-nginx`
`# vim /etc/nginx/sites-available/zabbix.conf` `# vim /etc/nginx/sites-available/zabbix.conf`
``` ```
@ -84,7 +84,7 @@ server {
add_header X-Content-Type-Options "nosniff"; add_header X-Content-Type-Options "nosniff";
location = / { location = / {
return 302 https://$host/web/; return 302 https://$host/index.php;
} }
location / { location / {
@ -119,3 +119,6 @@ server {
`# ln -s /etc/nginx/sites-available/zabbix.conf /etc/nginx/sites-enabled/` `# ln -s /etc/nginx/sites-available/zabbix.conf /etc/nginx/sites-enabled/`
`# systemctl restart nginx` `# systemctl restart nginx`
*You need to run the site in http mode first for certbot to work!*
`# certbot certonly --nginx --agree-tos --redirect --hsts --staple-ocsp --email (email) -d (domain1),(domain2)`