mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-25 01:52:40 +00:00
153 lines
5 KiB
Nginx Configuration File
153 lines
5 KiB
Nginx Configuration File
|
user ook;
|
||
|
|
||
|
# Set number of worker processes automatically based on number of CPU cores.
|
||
|
include /config/nginx/worker_processes.conf;
|
||
|
|
||
|
# Enables the use of JIT for regular expressions to speed-up their processing.
|
||
|
pcre_jit on;
|
||
|
|
||
|
# Configures default error logger.
|
||
|
error_log /config/log/nginx/error.log;
|
||
|
# Includes files with directives to load dynamic modules.
|
||
|
include /etc/nginx/modules/*.conf;
|
||
|
# Include files with config snippets into the root context.
|
||
|
include /etc/nginx/conf.d/*.conf;
|
||
|
|
||
|
events {
|
||
|
# The maximum number of simultaneous connections that can be opened by
|
||
|
# a worker process.
|
||
|
worker_connections 1024;
|
||
|
}
|
||
|
|
||
|
http {
|
||
|
# Name servers used to resolve names of upstream servers into addresses.
|
||
|
# It's also needed when using tcpsocket and udpsocket in Lua modules.
|
||
|
include /config/nginx/resolver.conf;
|
||
|
|
||
|
# Don't tell nginx version to the clients. Default is 'on'.
|
||
|
server_tokens off;
|
||
|
# Specifies the maximum accepted body size of a client request, as
|
||
|
# indicated by the request header Content-Length. If the stated content
|
||
|
# length is greater than this size, then the client receives the HTTP
|
||
|
# error code 413. Set to 0 to disable. Default is '1m'.
|
||
|
client_max_body_size 0;
|
||
|
# Sendfile copies data between one FD and other from within the kernel,
|
||
|
# which is more efficient than read() + write(). Default is off.
|
||
|
sendfile on;
|
||
|
# Causes nginx to attempt to send its HTTP response head in one packet,
|
||
|
# instead of using partial frames. Default is 'off'.
|
||
|
tcp_nopush on;
|
||
|
# Sends small packets as soon as they're available, decreasing latency at
|
||
|
# the cost of increased network overhead. Default is 'off'.
|
||
|
tcp_nodelay on;
|
||
|
# Specifies the maximum amount of time in seconds that a keep-alive
|
||
|
# connection will remain open if there are no new requests. Default is 75.
|
||
|
keepalive_timeout 65;
|
||
|
# Specifies the maximum amount of time in seconds that Nginx will wait for
|
||
|
# the client to send the entire request header. Default is 60.
|
||
|
send_timeout 20s;
|
||
|
|
||
|
# Sets the default charset. Default is 'off'.
|
||
|
charset utf-8;
|
||
|
# Defines the source charset of a response. Default is null.
|
||
|
source_charset utf-8;
|
||
|
# Enables module processing in responses with the specified MIME types.
|
||
|
# Default is 'text/html text/xml text/plain text/vnd.wap.wml
|
||
|
# application/javascript application/rss+xml'.
|
||
|
charset_types
|
||
|
application/atom+xml
|
||
|
application/javascript
|
||
|
application/json
|
||
|
application/rss+xml
|
||
|
image/svg+xml
|
||
|
text/css
|
||
|
text/plain
|
||
|
text/vcard
|
||
|
text/xml
|
||
|
;
|
||
|
|
||
|
default_type application/octet-stream;
|
||
|
# Sets the maximum size of the hash table used for mapping MIME types to
|
||
|
# file extensions. Default is 512.
|
||
|
types_hash_max_size 2048;
|
||
|
# Includes mapping of file name extensions to MIME types of responses
|
||
|
# and defines the default type.
|
||
|
include /config/nginx/mime.types;
|
||
|
|
||
|
# Enable gzipping of responses.
|
||
|
gzip on;
|
||
|
# Sets a gzip compression level of a response. Default is 1.
|
||
|
gzip_comp_level 9;
|
||
|
# Sets the minimum length of a response that will be gzipped. Default is 20.
|
||
|
gzip_min_length 256;
|
||
|
# Enables or disables gzipping of responses for proxied requests depending
|
||
|
# on the request and response. Default is 'off'.
|
||
|
gzip_proxied any;
|
||
|
# Sets the Vary HTTP header as defined in the RFC 2616. Default is 'off'.
|
||
|
gzip_vary on;
|
||
|
# Enables gzipping of responses for the specified MIME types in addition to
|
||
|
# “text/html”. Responses with the “text/html” type are always compressed.
|
||
|
# Default value is 'text/html'.
|
||
|
gzip_types
|
||
|
application/atom+xml
|
||
|
application/javascript
|
||
|
application/json
|
||
|
application/ld+json
|
||
|
application/manifest+json
|
||
|
application/rdf+xml
|
||
|
application/rss+xml
|
||
|
application/schema+json
|
||
|
application/vnd.geo+json
|
||
|
application/vnd.ms-fontobject
|
||
|
application/x-font-ttf
|
||
|
application/x-javascript
|
||
|
application/x-web-app-manifest+json
|
||
|
application/xhtml+xml
|
||
|
application/xml
|
||
|
font/eot
|
||
|
font/opentype
|
||
|
image/bmp
|
||
|
image/svg+xml
|
||
|
image/vnd.microsoft.icon
|
||
|
image/x-icon
|
||
|
text/cache-manifest
|
||
|
text/css
|
||
|
text/javascript
|
||
|
text/plain
|
||
|
text/vcard
|
||
|
text/vnd.rim.location.xloc
|
||
|
text/vtt
|
||
|
text/x-component
|
||
|
text/x-cross-domain-policy
|
||
|
text/xml
|
||
|
;
|
||
|
|
||
|
# Helper variable for proxying websockets.
|
||
|
map $http_upgrade $connection_upgrade {
|
||
|
default upgrade;
|
||
|
'' close;
|
||
|
}
|
||
|
|
||
|
# Sets the path, format, and configuration for a buffered log write.
|
||
|
access_log /config/log/nginx/access.log;
|
||
|
|
||
|
# Additional configs.
|
||
|
#include /config/nginx/http.d/*.conf;
|
||
|
|
||
|
# Fallback virtual server
|
||
|
server {
|
||
|
server_name ~^.*$;
|
||
|
listen 80;
|
||
|
|
||
|
location / {
|
||
|
return 503;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
# Includes virtual hosts configs.
|
||
|
include /config/nginx/hosts.conf;
|
||
|
}
|
||
|
|
||
|
daemon off;
|
||
|
pid /run/nginx.pid;
|