add domain configurations

This commit is contained in:
2026-05-15 17:18:46 +03:30
parent 49c38f3017
commit 4ea95e3786
5 changed files with 154 additions and 6 deletions

View File

@@ -0,0 +1,65 @@
# Laravel application vhost for nyone.net.
# Copy to /etc/nginx/sites-available/nyone-app.conf and symlink into sites-enabled.
# Adjust root and fastcgi_pass for your server.
server {
listen 80;
listen [::]:80;
server_name nyone.net;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name nyone.net;
root /var/www/nyone/public;
index index.php;
ssl_certificate /etc/letsencrypt/live/nyone.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nyone.net/privkey.pem;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
charset utf-8;
client_max_body_size 100M;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico {
access_log off;
log_not_found off;
}
location = /robots.txt {
access_log off;
log_not_found off;
}
location ~* \.(?:css|js|mjs|map|jpg|jpeg|gif|png|svg|ico|webp|avif|woff|woff2|ttf)$ {
expires 30d;
access_log off;
try_files $uri /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param HTTPS on;
fastcgi_read_timeout 120s;
}
location ~ /\.(?!well-known).* {
deny all;
}
}