-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphabricator_nginx.conf
More file actions
110 lines (95 loc) · 2.86 KB
/
phabricator_nginx.conf
File metadata and controls
110 lines (95 loc) · 2.86 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# MODIFY SECTIONS IF USING NGINX FOR SSL
# https://nginx.org/en/docs/ngx_core_module.html
user nginx;
worker_processes ${NGINX_WORKER_PROCESSES};
worker_rlimit_nofile ${NGINX_WORKER_RLIMIT_NOFILE};
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
multi_accept on;
worker_connections ${NGINX_WORKER_CONNECTIONS};
}
# https://nginx.org/en/docs/http/ngx_http_core_module.html
http {
charset utf-8;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
log_not_found off;
types_hash_max_size 2048;
types_hash_bucket_size 64;
keepalive_timeout 65s;
# MIME
include /etc/nginx/mime.types;
default_type application/octet-stream;
# https://nginx.org/en/docs/http/ngx_http_log_module.html
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
# https://nginx.org/en/docs/http/ngx_http_upstream_module.html
upstream fastcgi_backend {
server phabricator:9000;
}
# https://nginx.org/en/docs/http/ngx_http_ssl_module.html
# https://nginx.org/en/docs/http/configuring_https_servers.html
# UNCOMMENT IF USING NGINX FOR SSL
# server {
# listen 80;
# listen [::]:80;
# server_name ${NGINX_HOST};
# return 301 https://$host$request_uri;
# }
server {
# COMMENT IF USING NGINX FOR SSL
listen 80;
listen [::]:80;
# UNCOMMENT IF USING NGINX FOR SSL
# listen 443 ssl http2;
# listen [::]:443 ssl http2;
# ssl_certificate /etc/nginx/certs/${NGINX_SSL_CERT};
# ssl_certificate_key /etc/nginx/certs/${NGINX_SSL_KEY};
# https://nginx.org/en/docs/http/server_names.html
server_name ${NGINX_HOST};
# max file upload size
client_max_body_size ${NGINX_CLIENT_MAX_BODY_SIZE};
client_body_timeout ${NGINX_CLIENT_BODY_TIMEOUT};
# https://nginx.org/en/docs/http/ngx_http_gzip_module.html
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_min_length 256;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/json
application/javascript
application/x-javascript
application/xml
application/rss+xml
application/atom+xml
image/svg+xml;
# Website public root directory
root /var/www/html/phabricator/webroot;
location / {
index index.php;
rewrite ^/(.*)$ /index.php?__path__=/$1 last;
}
# https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
location /index.php {
fastcgi_pass fastcgi_backend;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
# COMMENT IF NOT USING HTTPS AT ALL
fastcgi_param HTTPS on;
}
}
}