etc-configs/nginx/conf.d/luna.zzls.xyz.conf

49 lines
1.1 KiB
Plaintext

server {
access_log /var/log/nginx/luna.zzls.xyz.access.log combined;
error_log /var/log/nginx/luna.zzls.xyz.error.log;
server_name luna.zzls.xyz luna.nadeko.net;
index index.php /_h5ai/public/index.php;
root /mnt/ssd/luna.zzls.xyz/;
include configs/general.conf;
include configs/security.conf;
add_header Access-Control-Allow-Origin *;
location /_h5ai/private {
return 403;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
add_header Access-Control-Allow-Origin *;
}
listen 443 ssl;
http2 on;
include configs/ssl.conf;
}
server {
set $x "";
if ($host = luna.zzls.xyz) {
set $x 1;
}
if ($host = luna.nadeko.net) {
set $x 1;
}
if ($x = 1) {
return 301 https://$host$request_uri;
}
listen 80;
server_name luna.zzls.xyz luna.nadeko.net;
return 404;
}