Skip to content

Instantly share code, notes, and snippets.

@kei-sato
Created April 28, 2016 09:00
Show Gist options
  • Save kei-sato/6f37a9c6504fcf3391ca027957a89d06 to your computer and use it in GitHub Desktop.
Save kei-sato/6f37a9c6504fcf3391ca027957a89d06 to your computer and use it in GitHub Desktop.
server {
listen 80;
charset utf-8;
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
location / {
root /usr/share/nginx/html;
index index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 65535;
multi_accept on;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format ltsv 'time:$time_iso8601\t'
'remote_addr:$remote_addr\t'
'request_method:$request_method\t'
'request_length:$request_length\t'
'request_uri:$request_uri\t'
'https:$https\t'
'uri:$uri\t'
'query_string:$query_string\t'
'status:$status\t'
'bytes_sent:$bytes_sent\t'
'body_bytes_sent:$body_bytes_sent\t'
'referer:$http_referer\t'
'useragent:$http_user_agent\t'
'forwardedfor:$http_x_forwarded_for\t'
'request_time:$request_time\t'
'upstream_response_time:$upstream_response_time\t'
'upstream_addr:$upstream_addr';
access_log /var/log/nginx/access.log ltsv;
sendfile on;
tcp_nopush on;
keepalive_timeout 30;
gzip on;
# hide version info
server_tokens off;
# response 304 depend on If-Modified-Since header
if_modified_since before;
include /etc/nginx/conf.d/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment