-
Notifications
You must be signed in to change notification settings - Fork 4
/
nginx.conf
42 lines (33 loc) · 1.09 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Main config file located at /etc/nginx/nginx.conf
user www-data;
worker_processes auto; # automatically make use of all available cores
pid /run/nginx.pid;
events {
worker_connections 1024; # run `ulimit -n` on server to get this number
use epoll; # [ kqueue | epoll | /dev/poll | select | poll ]
multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
# Server listening on port 80 for any requests and redirecting all of them to
# port 443 so that all requests are encrypted.
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#taxing-rewrites
server {
listen 80 default_server;
listen [::]:80 default_server;
# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}
include /etc/nginx/sites-enabled/*;
}