Skip to content
Snippets Groups Projects
Commit 7a4be25c authored by void's avatar void
Browse files

cleanup old configs

parent 18587def
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Certbot Renewal Hook to reload nginx when a certificate is renewed
systemctl reload nginx
server {
listen 80 default_server;
listen [::]:80 default_server;
{% if nginx_https == True %}
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
{% if 'test' in inventory_hostname %}
ssl_certificate /etc/letsencrypt/live/www.test.warpzone.ms/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.test.warpzone.ms/privkey.pem;
{% else %}
ssl_certificate /etc/letsencrypt/live/www.warpzone.ms/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.warpzone.ms/privkey.pem;
{% endif %}
{% endif %}
server_name _;
root /dev/null;
{% if 'test' in inventory_hostname %}
location / {
rewrite ^(.*) https://www.test.warpzone.ms$1 permanent;
}
{% else %}
location / {
rewrite ^(.*) https://www.warpzone.ms$1 permanent;
}
{% endif %}
}
server {
listen 9145;
location /status {
# Turn on nginx stats
stub_status on;
# I do not need logs for stats
access_log off;
# Security: Only allow access from
allow 127.0.0.1;
# Send rest of the world to /dev/null #
deny all;
}
}
# Read Nginx's basic status information (ngx_http_stub_status_module)
[[inputs.nginx]]
## An array of Nginx stub_status URI to gather stats.
urls = ["http://127.0.0.1:9145/status"]
## HTTP response timeout (default: 5s)
response_timeout = "5s"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment