rtfd/in/public/web/nginx/configure.rst

72 lines
1.2 KiB
ReStructuredText
Raw Normal View History

2017-12-02 22:02:37 +00:00
*********
Configure
*********
* /etc/nginx/nginx.conf
.. code::
2019-08-04 15:23:42 +00:00
pid /run/nginx.pid;
user user;
worker_processes auto;
2017-12-02 22:02:37 +00:00
2019-08-04 15:23:42 +00:00
events {
2019-08-04 15:26:56 +00:00
multi_accept off;
worker_connections 512;
2019-08-04 15:23:42 +00:00
}
2017-12-02 22:02:37 +00:00
2019-08-04 15:23:42 +00:00
http {
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
# General
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
keepalive_timeout 60;
sendfile on;
server_tokens off;
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
# Names
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
server_name_in_redirect off;
server_names_hash_bucket_size 128;
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
# File types
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
include /etc/nginx/mime.types;
default_type application/octet-stream;
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
# Security
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
ssl_buffer_size 8k;
2019-08-04 16:57:26 +00:00
ssl_ciphers "TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,TLS_AES_128_GCM_SHA256,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-RSA-CHACHA20-POLY1305,ECDHE-ARIA256-GCM-SHA384,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ARIA128-GCM-SHA256";
2019-08-04 15:26:56 +00:00
ssl_ecdh_curve secp384r1;
ssl_prefer_server_ciphers on;
2019-08-04 15:37:37 +00:00
ssl_protocols TLSv1.3 TLSv1.2;
2019-08-04 15:26:56 +00:00
ssl_session_cache shared:ssl_session_cache:16m;
ssl_session_timeout 15m;
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
# Log
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
# Compression
2017-12-02 22:02:37 +00:00
2019-08-04 15:30:39 +00:00
gzip off;
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
# Misc
2017-12-02 22:02:37 +00:00
2019-08-04 15:26:56 +00:00
add_header Strict-Transport-Security max-age=31557600;
client_max_body_size 16m;
index index.html;
proxy_pass_request_body on;
proxy_pass_request_headers on;
proxy_redirect off;
# Includes
include /etc/nginx/sites-enabled/*;
2017-12-02 22:02:37 +00:00
2019-08-04 15:23:42 +00:00
}