-
Notifications
You must be signed in to change notification settings - Fork 50
/
nginx-virtual-host-php-fpm.conf
53 lines (35 loc) · 1.04 KB
/
nginx-virtual-host-php-fpm.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
server {
listen 80;
server_name api.example.com www.api.example.com;
root /need/to/replace/this/api.example.com/public;
charset utf-8;
rewrite_log on;
client_max_body_size 5M;
# Very Important
underscores_in_headers on;
location / {
index index.php;
if (-f $request_filename) {
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?_url=$1 last;
break;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $request_uri;
fastcgi_param SCRIPT_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# Custom Headers specifically for HMAC API
fastcgi_param API_ID $http_api_id;
fastcgi_param API_TIME $http_api_time;
fastcgi_param API_HASH $http_api_hash;
fastcgi_buffers 256 16k;
}
}