configurations/Nginx/Server Blocks/journal.libraryofcode.org.conf

45 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2021-07-08 22:58:44 -04:00
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name journal.libraryofcode.org;
root /var/www/ojs;
ssl_certificate /etc/nginx/ssl/org.chain.crt;
ssl_certificate_key /etc/nginx/ssl/org.key.pem;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
2021-07-08 23:58:13 -04:00
2021-07-08 22:58:44 -04:00
location / {
2021-07-08 23:55:22 -04:00
try_files $uri $uri/ /index.php?$query_string;
2021-07-08 22:58:44 -04:00
}
2021-07-08 23:55:22 -04:00
2021-07-08 22:58:44 -04:00
error_page 404 /index.php;
location ~ ^(.+\.php)(.*)$ {
set $path_info $fastcgi_path_info;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $path_info;
fastcgi_param PATH_TRANSLATED $document_root$path_info;
2021-07-08 23:21:58 -04:00
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
2021-07-08 23:15:23 -04:00
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
2021-07-08 22:58:44 -04:00
fastcgi_index index.php;
2021-07-08 23:21:58 -04:00
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
2021-07-08 22:58:44 -04:00
}
location ~ /\.(?!well-known).* {
deny all;
}
}