server {
root /var/www/images;
index index.html index.htm index.nginx-debian.html;
server_name images.nunosempere.com;
location / {
# First attempt to serve request as file, then# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbotlisten443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/images.nunosempere.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/images.nunosempere.com/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 = images.nunosempere.com) {
return301 https://$host$request_uri;
} # managed by Certbotlisten80;
listen [::]:80;
server_name images.nunosempere.com;
return404; # managed by Certbot
}
How do you upload them though ? Serving images is easy, but the upload part from wherever (my laptop, my tablet, your phone, …) is the “hardest” one if you want an imgur-like upload form. Do you require authentication? Maximum file size? Persistence? etc…
I host my own images on my server using nginx to serve them from /var/www/images. You can see an example here: https://images.nunosempere.com/blog/2023/02/19/bayesian-adjustment-to-rethink-priorities-welfare-range-estimates/ignore-the-prior.png
The nginx configuration I’m using is
server { root /var/www/images; index index.html index.htm index.nginx-debian.html; server_name images.nunosempere.com; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } listen [::]:443 ssl ipv6only=on; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/images.nunosempere.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/images.nunosempere.com/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 = images.nunosempere.com) { return 301 https://$host$request_uri; } # managed by Certbot listen 80; listen [::]:80; server_name images.nunosempere.com; return 404; # managed by Certbot }
How do you upload them though ? Serving images is easy, but the upload part from wherever (my laptop, my tablet, your phone, …) is the “hardest” one if you want an imgur-like upload form. Do you require authentication? Maximum file size? Persistence? etc…