-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.conf
71 lines (61 loc) · 2.04 KB
/
default.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
###################
### Symfony BFF ###
###################
server {
index index.php index.html;
root /srv/www/symfony_front/public;
listen 80;
location ~* \.(js|css|png|jpg|jpeg|gif|ico|html|svg|eot|ttf|woff|woff2)$ {
expires max;
}
location / {
try_files $uri $uri/ /index.php?$args;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass phpfpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
#####################
### Sylius config ###
#####################
server {
server_name example.com;
root /srv/www/sylius_api/public;
listen 8080;
location / {
try_files $uri @rewriteapp; # Redirect to app.php if the requested file does not exist.
}
# Production rule-set.
location ~ ^/index\.php(/|$) {
fastcgi_pass phpfpm:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/app.php/some-path
# Remove the internal directive to allow URIs like this.
internal;
}
# Static files rule-set.
location ~ \.(js|css|png|jpeg|jpg|gif|ico|swf|flv|pdf|zip)$ {
# Set rules only if the file actually exists.
if (-f $request_filename) {
# Set expiry date to 1 year in the future.
expires 365d;
# Further optimize by not logging access to these files.
access_log off;
}
# Rewrite to app.php if the requested file does not exist.
try_files $uri @rewriteapp;
}
# Rewrite rule for PHP files.
location @rewriteapp {
rewrite ^(.*)$ /index.php/$1 last;
}
error_log /var/log/nginx/example.com_error.log;
access_log /var/log/nginx/example.com_access.log;
}