54 lines
No EOL
1.5 KiB
Nginx Configuration File
54 lines
No EOL
1.5 KiB
Nginx Configuration File
server {
|
|
listen 80 default_server;
|
|
|
|
set $base /var/www/opentrashmail;
|
|
root $base/web/;
|
|
|
|
index index.php;
|
|
|
|
client_max_body_size 10M;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php;
|
|
}
|
|
|
|
|
|
# logging
|
|
access_log /var/www/opentrashmail/logs/web.access.log;
|
|
error_log /var/www/opentrashmail/logs/web.error.log warn;
|
|
|
|
location ~ \.php$ {
|
|
# 404
|
|
try_files $fastcgi_script_name =404;
|
|
|
|
# default fastcgi_params
|
|
include fastcgi_params;
|
|
|
|
# fastcgi settings
|
|
fastcgi_pass 127.0.0.1:9000;
|
|
fastcgi_index index.php;
|
|
fastcgi_buffers 8 16k;
|
|
fastcgi_buffer_size 32k;
|
|
|
|
# fastcgi params
|
|
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
|
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
|
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$base/:/usr/lib/php/:/tmp/";
|
|
}
|
|
|
|
# security headers
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
|
add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
|
|
|
|
# gzip
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
|
|
|
|
} |