Skip to content

Instantly share code, notes, and snippets.

@changhuixu
Last active July 8, 2020 16:47
Show Gist options
  • Select an option

  • Save changhuixu/7c176e6e7ded24674e81afcb70a2503f to your computer and use it in GitHub Desktop.

Select an option

Save changhuixu/7c176e6e7ded24674e81afcb70a2503f to your computer and use it in GitHub Desktop.
# Run as a less privileged user for security reasons.
user nginx;
# #worker_threads to run;
# "auto" sets it to the #CPU_cores available in the system, and
# offers the best performance.
worker_processes auto;
events { worker_connections 1024; }
http {
server {
# Hide nginx version information.
server_tokens off;
listen 80;
root /usr/share/nginx/html;
include /etc/nginx/mime.types;
location / {
try_files $uri $uri/ /index.html;
}
gzip on;
gzip_vary on;
gzip_http_version 1.0;
gzip_comp_level 5;
gzip_types
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/x-component;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 256;
gunzip on;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment