forked from scil/LaravelFly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswoole_fallback_to_phpfpm.conf
61 lines (48 loc) · 1.45 KB
/
swoole_fallback_to_phpfpm.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
upstream laravelfly_group {
server 127.0.0.1:9501 weight=1 max_fails=1 fail_timeout=10 ;
server 127.0.0.1:81 backup;
}
log_format my_upstream '$remote_addr|$time_local|$request_time|$upstream_response_time|$status '
'$upstream_addr|$request';
server {
server_name fly.test;
listen 80;
root /www/fly/public;
index index.html;
charset utf-8;
location = / {
# if you have a static home page , try this one:
# try_files index.html @other;
try_files '' @php;
}
location / {
try_files $uri $uri/ @php;
}
location @php {
proxy_pass http://laravelfly_group;
proxy_http_version 1.1;
proxy_set_header Connection "keep-alive";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
# just a mark for different upstream server, you can disable it
add_header X-Upstream $upstream_addr;
# log
access_log /var/log/nginx/upstream.log my_upstream;
}
}
server {
server_name fly.test;
listen 81;
root /vagrant/www/zc/public;
index index.html index.php;
charset utf-8;
location / {
try_files '' /index.php?$query_string;
}
location /index.php {
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
}