Page MenuHomeSealhub

nginx.conf

Authored By
kuba-orlik
Jun 23 2024, 23:40
Size
5 KB
Referenced Files
None
Subscribers
None

nginx.conf

user www-data;
worker_processes auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
multi_accept on;
use epoll;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 24h;
# set the buffer size to 1400 bytes (that way it fits into a single MTU).
ssl_buffer_size 1400;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
client_max_body_size 20m;
client_body_buffer_size 1m;
##
# Start: Timeouts
##
client_body_timeout 10;
client_header_timeout 10;
keepalive_timeout 5 5;
send_timeout 10;
# keys_zone=fasada:10m - how long the cache is considered fresh
# max_size=5G - we're fine with large cache size on disk
# inactive=48h - stale cached content is retained in cache for 12h at least
# this is necessary if we want to be able to serve stale content
# in case of errors longer than the time the cache is considered "fresh"
# which we do -- this gives us the ability to survive a backend crash
# with most users not noticing
proxy_cache_path /var/cache/proxy levels=1:2 keys_zone=fasada:10m max_size=5G inactive=48h;
# A cached response is first written to a temporary file, and then the file is renamed.
# Starting from version 0.8.9, temporary files and the cache can be put on different file systems.
# However, be aware that in this case a file is copied across two file systems instead of
# the cheap renaming operation. It is thus recommended that for any given location both
# cache and a directory holding temporary files are put on the same file system. The directory
# for temporary files is set based on the use_temp_path parameter (1.7.10).
#
proxy_temp_path /var/cache/tmp/ 1 2;
proxy_cache_key $scheme:$request_method:$host/$uri$is_args$args;
proxy_cache_bypass $http_pragma $http_cookie;
proxy_set_header Host $http_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-Proto $scheme;
proxy_intercept_errors on;
proxy_buffering on;
proxy_buffer_size 128k;
proxy_buffers 256 16k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_max_temp_file_size 0;
# Defines a timeout for establishing a connection with a proxied server.
# It should be noted that this timeout cannot usually exceed 75 seconds.
#
# This should be short; we want the back-end to time-out before the client
# connection does. This way the visitor receives a cached version instead
# of a generic timeout
proxy_connect_timeout 2;
# Sets a timeout for transmitting a request to the proxied server.
# The timeout is set only between two successive write operations,
# not for the transmission of the whole request.
# If the proxied server does not receive anything within this time,
# the connection is closed.
proxy_send_timeout 120;
# Defines a timeout for reading a response from the proxied server.
# The timeout is set only between two successive read operations,
# not for the transmission of the whole response.
# If the proxied server does not transmit anything within this time,
# the connection is closed.
proxy_read_timeout 5;
# redirect map in http block - remove fbclid argument from the end
# context:
# https://gist.github.com/lynt-smitka/b5ff2cab70443c17a214006a4d5bc48c
# https://community.cloudflare.com/t/facebook-now-adds-fbclid-query-string-to-urls-busting-cloudflares-cache/40355
map $request_uri $redirect_fbclid {
"~^(.*?)([?&]fbclid=[a-zA-Z0-9_-]+)$" $1;
}
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites/*.conf;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
497204
Default Alt Text
nginx.conf (5 KB)

Event Timeline

kuba-orlik changed the visibility from "All Users" to "Public (No Login Required)".Jun 23 2024, 23:44