53 lines
1.1 KiB
Plaintext
53 lines
1.1 KiB
Plaintext
server {
|
|
listen 443 ssl http2;
|
|
server_name paste.linuxiarz.pl;
|
|
set $base /var/www/paste.linuxiarz.pl;
|
|
root $base;
|
|
|
|
include config/wildcard.conf;
|
|
|
|
# security
|
|
# include config/security.conf;
|
|
|
|
# restrict methods
|
|
if ($request_method !~ ^(GET|POST)$) {
|
|
return '405';
|
|
}
|
|
|
|
# logging
|
|
access_log /var/log/nginx/paste.linuxiarz.pl.access.log;
|
|
error_log /var/log/nginx/paste.linuxiarz.pl.error.log warn;
|
|
|
|
# index.php
|
|
index index.php;
|
|
|
|
# index.php fallback
|
|
location / {
|
|
try_files $uri /index.php;
|
|
}
|
|
|
|
if ($request_uri !~* ^/(static|favicon\.ico|robots\.txt)) {
|
|
rewrite ^/(.*)$ /index.php?/$1 last;
|
|
break;
|
|
}
|
|
|
|
# additional config
|
|
include config/general.conf;
|
|
|
|
# handle .php
|
|
location ~ \.php$ {
|
|
# include config/php_fastcgi.conf;
|
|
include config/php_fastcgi8_1.conf;
|
|
}
|
|
}
|
|
|
|
# HTTP redirect
|
|
server {
|
|
listen 80;
|
|
server_name paste.linuxiarz.pl;
|
|
|
|
location / {
|
|
return 301 https://paste.linuxiarz.pl$request_uri;
|
|
}
|
|
}
|