forked from fliespl/multi-php-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.conf
68 lines (55 loc) · 1.8 KB
/
example.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
server {
server_name www.los-santos.loc;
return 301 $scheme://los-santos.loc$request_uri;
}
server {
set $project_root "/home/bst/workspace/los-santos";
listen 80;
server_name los-santos.loc;
root $project_root/web;
access_log /var/log/nginx/$host-access.log vcombined;
error_log /var/log/nginx/error.log;
# START - front
location /main {
alias $project_root/front_out/build;
try_files $uri $uri/ /index.html =404;
}
location /bundles {
try_files $uri $uri/ =404;
access_log off;
log_not_found off;
expires max;
}
location /socket.io {
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;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:3000;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# END - front
# START - backend
location / {
# try to serve file directly, fallback to app.php
try_files $uri /app.php$is_args$args;
}
location ~* \.(eot|otf|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
}
location ~ ^/(app_dev|app|config)\.php(/|$) {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param PHP_VALUE "upload_max_filesize=256M;\npost_max_size=256M;\nmax_execution_time=120;\nmax_input_time=120;";
}
# END - backend
location ~ \.php$ {
return 404;
}
}