65 lines
1.4 KiB
Plaintext
65 lines
1.4 KiB
Plaintext
server {
|
|
listen 443 quic;
|
|
listen 443 ssl;
|
|
http2 on;
|
|
http3 on;
|
|
ssl_protocols TLSv1.3 TLSv1.2;
|
|
ssl_early_data on;
|
|
add_header Alt-Svc 'h3=":$server_port"; ma=86400';
|
|
|
|
server_name repo.linuxiarz.pl;
|
|
set $base /var/www/repo.linuxiarz.pl;
|
|
root $base;
|
|
|
|
include config/wildcard.conf;
|
|
|
|
index index.php;
|
|
# security
|
|
include config/security.conf;
|
|
|
|
# restrict methods
|
|
if ($request_method !~ ^(GET)$) {
|
|
return '405';
|
|
}
|
|
|
|
# logging
|
|
access_log /var/log/nginx/repo.linuxiarz.pl.access.log;
|
|
error_log /var/log/nginx/repo.linuxiarz.pl.error.log warn;
|
|
|
|
|
|
location ~* \.(?:tar.gz|zip?)$ {
|
|
rewrite ^/(.*)$ https://objectstorage.eu-frankfurt-1.oraclecloud.com/n/frhsuwgawuyg/b/linuxiarz-repo/o/$1 permanent;
|
|
}
|
|
|
|
|
|
location / {
|
|
# try_files $uri $uri/ /index.php?dl=$uri;
|
|
try_files $uri $uri/ /index.php?$uri;
|
|
}
|
|
|
|
# additional config
|
|
include config/general.conf;
|
|
|
|
# handle .php
|
|
location ~ \.php$ {
|
|
include config/php_fastcgi.conf;
|
|
}
|
|
|
|
}
|
|
|
|
# HTTP redirect
|
|
server {
|
|
listen 80;
|
|
server_name repo.linuxiarz.pl;
|
|
add_header Alt-Svc 'h3=":443"; ma=86400';
|
|
|
|
# restrict methods
|
|
if ($request_method !~ ^(GET)$) {
|
|
return '405';
|
|
}
|
|
|
|
location / {
|
|
return 301 https://repo.linuxiarz.pl$request_uri;
|
|
}
|
|
}
|