Skip to content

Instantly share code, notes, and snippets.

@ItsOnlyBinary
Created October 24, 2025 20:26
Show Gist options
  • Select an option

  • Save ItsOnlyBinary/ebde622e7d3d960713c03b8e4f802077 to your computer and use it in GitHub Desktop.

Select an option

Save ItsOnlyBinary/ebde622e7d3d960713c03b8e4f802077 to your computer and use it in GitHub Desktop.
server {
server_name avatars.example.com;
listen 443 ssl;
listen 443 quic;
listen [::]:443 ssl;
listen [::]:443 quic;
http2 on;
# advertise that QUIC is available on the configured port
add_header Alt-Svc 'h3=":$server_port"; ma=86400';
ssl_certificate /etc/letsencrypt/live/avatars.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/avatars.example.com/privkey.pem;
access_log /var/log/nginx/example.com/avatars/access.log main;
error_log /var/log/nginx/example.com/avatars/error.log;
location /api.php {
alias /var/www/example.com/avatars-api/api.php;
try_files $fastcgi_script_name =401;
# default fastcgi_params
include fastcgi_params;
# fastcgi settings
fastcgi_pass unix:/run/php-fpm-legacy/php-fpm.sock;
fastcgi_index index.php;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
# fastcgi params
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
}
location = / {
default_type text/html;
return 200;
}
location / {
alias /var/www/example.com/avatars/;
expires 2h;
add_header Cache-Control public;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment