-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
79 lines (66 loc) · 1.69 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
worker_processes auto;
user www-data www-data;
events { worker_connections 1024; }
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
add_header X-XSS-Protection "1; mode=block";
add_header X-Frame-Options SAMEORIGIN always;
add_header X-Content-Type-Options "nosniff" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_types
application/atom+xml
application/javascript
application/x-javascript
application/manifest+json
application/rdf+xml
application/rss+xml
application/xhtml+xml
application/xml
text/css
text/javascript
text/plain
text/xml;
keepalive_timeout 65;
client_max_body_size 80M;
server_tokens off;
absolute_redirect off;
port_in_redirect off;
upstream php {
server 127.0.0.1:9000;
}
server {
listen 80;
root /var/www/html;
index index.php index.html index.htm;
location / {
include /etc/nginx/mime.types;
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Deny all attempts to access hidden files such as .htaccess or .htpasswd
location ~ /\. {
deny all;
}
# Block xmlrpc.php
location = /xmlrpc.php {
deny all;
}
# Block nginx.conf
location = /nginx.conf {
deny all;
}
}
}