61 lines
2.3 KiB
Plaintext
61 lines
2.3 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name pan.farinear.cn;
|
|
rewrite ^ https://$http_host$request_uri? permanent; # force redirect http to https
|
|
server_tokens off; # Enables or disables emitting nginx version on error pages and in the "Server" response header field.
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
ssl_certificate /etc/letsencrypt/live/pan.farinear.cn/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/pan.farinear.cn/privkey.pem;
|
|
server_name pan.farinear.cn;
|
|
|
|
server_tokens off;
|
|
|
|
ssl_session_timeout 5m;
|
|
ssl_session_cache shared:SSL:5m;
|
|
# secure settings (A+ at SSL Labs ssltest at time of writing)
|
|
# see https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
|
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-SEED-SHA:DHE-RSA-CAMELLIA128-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
|
|
ssl_prefer_server_ciphers on;
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Host $server_name;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
|
|
proxy_read_timeout 1200s;
|
|
|
|
# used for view/edit office file via Office Online Server
|
|
client_max_body_size 0;
|
|
|
|
access_log /var/log/nginx/seahub.access.log;
|
|
error_log /var/log/nginx/seahub.error.log;
|
|
}
|
|
|
|
location /seafhttp {
|
|
rewrite ^/seafhttp(.*)$ $1 break;
|
|
proxy_pass http://127.0.0.1:8082;
|
|
client_max_body_size 0;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_connect_timeout 36000s;
|
|
proxy_read_timeout 36000s;
|
|
proxy_send_timeout 36000s;
|
|
|
|
send_timeout 36000s;
|
|
|
|
proxy_request_buffering off;
|
|
}
|
|
|
|
location /media {
|
|
root /faronear/bin.seafile/sea/seahub;
|
|
}
|
|
}
|