Many improvements to the server #4
@ -3,35 +3,34 @@ events {
|
|||||||
}
|
}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
access_log /dev/stdout;
|
access_log /dev/stdout; # Log access to stdout
|
||||||
error_log /dev/stdout;
|
error_log /dev/stdout; # Log errors to stdout
|
||||||
|
|
||||||
|
# Log format
|
||||||
log_format main '[$time_local] "$request" '
|
log_format main '[$time_local] "$request" '
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
include mime.types;
|
include mime.types; # Include the mime types file
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream; # Default type
|
||||||
|
|
||||||
sendfile on;
|
sendfile on; # Send files directly from disk
|
||||||
tcp_nopush on;
|
keepalive_timeout 15; # Keep connections alive for 15 seconds
|
||||||
tcp_nodelay on;
|
types_hash_max_size 4096; # Max number of mime types
|
||||||
keepalive_timeout 15;
|
|
||||||
types_hash_max_size 4096;
|
# TCP optimizations
|
||||||
|
tcp_nopush on; # Send headers in one packet
|
||||||
|
tcp_nodelay on; # Don't wait for packets to be full
|
||||||
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
server_name _;
|
server_name _; # Listen on all hostnames
|
||||||
listen 80;
|
listen 80; # Listen on port 80
|
||||||
|
|
||||||
root /var/www/html;
|
root /var/www/html; # Serve files from /var/www/html
|
||||||
index index.html index.htm;
|
index index.html index.htm; # Serve index.html and index.htm by default
|
||||||
|
|
||||||
# TCP optimizations
|
|
||||||
tcp_nopush on;
|
|
||||||
tcp_nodelay on;
|
|
||||||
|
|
||||||
# Gzip
|
# Gzip
|
||||||
sendfile on;
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_disable "msie6";
|
gzip_disable "msie6";
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
@ -42,6 +41,7 @@ http {
|
|||||||
|
|
||||||
client_max_body_size 500M; # Will get replaced by the environment variable MAX_UPLOAD_SIZE
|
client_max_body_size 500M; # Will get replaced by the environment variable MAX_UPLOAD_SIZE
|
||||||
|
|
||||||
|
# Upload endpoint
|
||||||
location /upload.php {
|
location /upload.php {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
|
|
||||||
@ -53,7 +53,8 @@ http {
|
|||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
# Serve your files
|
||||||
|
location / {
|
||||||
expires 7d;
|
expires 7d;
|
||||||
|
|
||||||
open_file_cache max=1000 inactive=60s;
|
open_file_cache max=1000 inactive=60s;
|
||||||
|
Loading…
Reference in New Issue
Block a user