Instantly share code, notes, and snippets.

Embed
What would you like to do?
status.icu nginx configuration
server {
root /var/www/status.icu;
index index.html;
server_name status.icu;
location / {
try_files $uri $uri/ =500;
}
location ~ /200 {
return 200 '200 ok';
add_header Content-Type text/plain;
}
location ~ /201 {
return 201;
}
location ~ /202 {
return 202;
}
location ~ /204 {
return 204;
}
location ~ /401 {
return 401;
}
location ~ /402 {
return 402;
}
location ~ /403 {
return 403;
}
location ~ /404 {
return 404;
}
location ~ /422 {
return 422;
}
location ~ /500 {
return 500;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/status.icu/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/status.icu/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = status.icu) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name status.icu;
return 404; # managed by Certbot
}
@askz

This comment has been minimized.

askz commented Jun 5, 2018

You do not reveal your logs configuration.
With this config, you can still have log file enable in main http block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment