Files
tmail-flutter/server/nginx.conf
T

69 lines
2.2 KiB
Nginx Configuration File

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
server_tokens off;
add_header Cache-Control "no-cache";
etag on;
# Security headers. They are inherited by every location below as long
# as the location does not declare its own add_header.
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer" always;
# Observation first: violations are only reported in the browser console.
# Switch to Content-Security-Policy once the reports are clean.
# frame-ancestors must list the Cozy origin when COZY_INTEGRATION is used.
add_header Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; connect-src 'self' https: wss:; frame-src 'self' blob: about:; worker-src 'self' blob:; frame-ancestors 'self'; object-src 'none'; base-uri 'self'; form-action 'none'" always;
# include /etc/nginx/conf.d/*.conf;
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
# Self-hosted ES modules (web/js): the stock mime.types does not map
# .mjs, and browsers refuse module scripts served as octet-stream.
location ~* \.mjs$ {
root /usr/share/nginx/html;
types { }
default_type application/javascript;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
gzip_static on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_http_version 1.1;
}