47 lines
1.1 KiB
Nginx Configuration File
47 lines
1.1 KiB
Nginx Configuration File
worker_processes 4;
|
|
# nginx.conf
|
|
events {
|
|
worker_connections 4096;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
|
|
open_file_cache max=1000 inactive=20s;
|
|
open_file_cache_valid 30s;
|
|
open_file_cache_min_uses 2;
|
|
open_file_cache_errors on;
|
|
|
|
|
|
server {
|
|
listen 80;
|
|
|
|
server_name lab.gg;
|
|
|
|
# Root directory for serving files
|
|
root /usr/share/nginx/html;
|
|
|
|
# Default file to serve
|
|
index index.html index.htm;
|
|
|
|
# Logging
|
|
access_log /var/log/nginx/access.log;
|
|
error_log /var/log/nginx/error.log;
|
|
|
|
gzip on;
|
|
gzip_proxied any;
|
|
gzip_types text/html text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
|
|
server_tokens off;
|
|
|
|
# Enable caching for static content for 15 minutes
|
|
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|webp|woff|woff2|ttf|otf|eot)$ {
|
|
expires 15m;
|
|
add_header Cache-Control "public, max-age=900";
|
|
try_files $uri.gz $uri =404;
|
|
}
|
|
}
|
|
} |