environment/recipes/nginx/static.erb
2025-08-01 20:11:48 +02:00

31 lines
No EOL
788 B
Text

server {
listen 443 ssl;
server_name ~^(?<username>[^.]+)\.gurgul\.pro$;
ssl_certificate /etc/letsencrypt/live/gurgul.pro/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/gurgul.pro/privkey.pem;
root /home/$username/website;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ =404;
}
## Optional: handle PHP (if using PHP)
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
# fastcgi_pass unix:/run/php/php8.1-fpm.sock; # adjust PHP version as needed
#}
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf)$ {
expires 7d;
access_log off;
}
}
server {
listen 80;
server_name ~^(?<username>[^.]+)\.gurgul\.pro$;
return 301 https://$host$request_uri;
}