|
18 | 18 | # }
|
19 | 19 |
|
20 | 20 |
|
21 |
| -root $MAGE_ROOT; |
22 |
| - |
| 21 | +root $MAGE_ROOT/pub; |
23 | 22 |
|
24 | 23 | index index.php;
|
25 | 24 | autoindex off;
|
26 |
| -# disable_symlinks on; |
27 | 25 | charset off;
|
28 | 26 |
|
29 |
| -location /setup/ { |
30 |
| - rewrite / /setup/index.php; |
31 |
| - |
32 |
| - location /setup/pub/ {} |
| 27 | +location /setup { |
| 28 | + root $MAGE_ROOT; |
33 | 29 |
|
34 |
| - location /setup/index.php { |
| 30 | + location ~ ^/setup/index.php { |
35 | 31 | fastcgi_pass fastcgi_backend;
|
36 |
| - |
37 | 32 | fastcgi_index index.php;
|
38 | 33 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
39 | 34 | include fastcgi_params;
|
40 | 35 | }
|
41 | 36 | }
|
42 | 37 |
|
43 | 38 | location / {
|
44 |
| - root $MAGE_ROOT/pub; |
45 |
| - |
46 |
| - location / { |
47 |
| - rewrite / /index.php ; |
48 |
| - } |
49 |
| - |
50 |
| - location /static/ { |
51 |
| - |
52 |
| - if ($MAGE_MODE = "production") { |
53 |
| - expires max; |
54 |
| - } |
55 |
| - |
56 |
| - location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ { |
57 |
| - add_header Cache-Control "public"; |
58 |
| - expires +1y; |
59 |
| - |
60 |
| - if (!-f $request_filename) { |
61 |
| - rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last; |
62 |
| - } |
63 |
| - } |
64 |
| - |
65 |
| - location ~* \.(zip|gz|gzip|bz2|csv|xml)$ { |
66 |
| - add_header Cache-Control "no-store"; |
67 |
| - expires off; |
| 39 | + try_files $uri $uri/ /index.php?$args; |
| 40 | +} |
68 | 41 |
|
69 |
| - if (!-f $request_filename) { |
70 |
| - rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last; |
71 |
| - } |
| 42 | +location /pub { |
| 43 | + alias $MAGE_ROOT/pub; |
| 44 | +} |
72 | 45 |
|
73 |
| - } |
| 46 | +location /static/ { |
| 47 | + if ($MAGE_MODE = "production") { |
| 48 | + expires max; |
| 49 | + } |
| 50 | + location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ { |
| 51 | + add_header Cache-Control "public"; |
| 52 | + expires +1y; |
74 | 53 |
|
75 | 54 | if (!-f $request_filename) {
|
76 | 55 | rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
|
77 | 56 | }
|
78 | 57 | }
|
79 |
| - |
80 |
| - location /media/ { |
81 |
| - |
82 |
| - location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ { |
83 |
| - add_header Cache-Control "public"; |
84 |
| - expires +1y; |
85 |
| - |
86 |
| - if (!-f $request_filename) { |
87 |
| - rewrite / /get.php; |
88 |
| - } |
89 |
| - } |
90 |
| - |
91 |
| - location ~* \.(zip|gz|gzip|bz2|csv|xml)$ { |
92 |
| - add_header Cache-Control "no-store"; |
93 |
| - expires off; |
94 |
| - |
95 |
| - if (!-f $request_filename) { |
96 |
| - rewrite / /get.php; |
97 |
| - } |
98 |
| - } |
| 58 | + location ~* \.(zip|gz|gzip|bz2|csv|xml)$ { |
| 59 | + add_header Cache-Control "no-store"; |
| 60 | + expires off; |
99 | 61 |
|
100 | 62 | if (!-f $request_filename) {
|
101 |
| - rewrite / /get.php; |
| 63 | + rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last; |
102 | 64 | }
|
103 | 65 | }
|
104 |
| - |
105 |
| - location /media/customer/ { |
106 |
| - deny all; |
| 66 | + if (!-f $request_filename) { |
| 67 | + rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last; |
107 | 68 | }
|
| 69 | +} |
108 | 70 |
|
109 |
| - location /media/downloadable/ { |
110 |
| - deny all; |
| 71 | +location /media/ { |
| 72 | + try_files $uri $uri/ /get.php?$args; |
| 73 | + location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ { |
| 74 | + add_header Cache-Control "public"; |
| 75 | + expires +1y; |
| 76 | + try_files $uri $uri/ /get.php?$args; |
111 | 77 | }
|
112 |
| - |
113 |
| - location ~ /media/theme_customization/.*\.xml$ { |
114 |
| - deny all; |
| 78 | + location ~* \.(zip|gz|gzip|bz2|csv|xml)$ { |
| 79 | + add_header Cache-Control "no-store"; |
| 80 | + expires off; |
| 81 | + try_files $uri $uri/ /get.php?$args; |
115 | 82 | }
|
| 83 | +} |
116 | 84 |
|
117 |
| - location /errors/ { |
118 |
| - try_files $uri =404; |
119 |
| - } |
| 85 | +location /media/customer/ { |
| 86 | + deny all; |
| 87 | +} |
120 | 88 |
|
121 |
| - location ~ ^/errors/.*\.(xml|phtml)$ { |
122 |
| - deny all; |
123 |
| - } |
| 89 | +location /media/downloadable/ { |
| 90 | + deny all; |
| 91 | +} |
124 | 92 |
|
125 |
| - location ~ cron\.php { |
126 |
| - deny all; |
127 |
| - } |
| 93 | +location ~ /media/theme_customization/.*\.xml$ { |
| 94 | + deny all; |
| 95 | +} |
128 | 96 |
|
129 |
| - location ~ (index|get|static|report|404|503)\.php$ { |
130 |
| - expires -1; |
131 |
| - fastcgi_pass fastcgi_backend; |
| 97 | +location /errors/ { |
| 98 | + try_files $uri =404; |
| 99 | +} |
132 | 100 |
|
133 |
| - fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; |
134 |
| - fastcgi_param PHP_VALUE "memory_limit=256M \n max_execution_time=600"; |
135 |
| - fastcgi_read_timeout 600s; |
136 |
| - fastcgi_connect_timeout 600s; |
137 |
| - fastcgi_param MAGE_MODE $MAGE_MODE; |
| 101 | +location ~ ^/errors/.*\.(xml|phtml)$ { |
| 102 | + deny all; |
| 103 | +} |
138 | 104 |
|
139 |
| - fastcgi_index index.php; |
140 |
| - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
141 |
| - include fastcgi_params; |
142 |
| - } |
| 105 | +location ~ cron\.php { |
| 106 | + deny all; |
| 107 | +} |
| 108 | + |
| 109 | +location ~ (index|get|static|report|404|503)\.php$ { |
| 110 | + try_files $uri =404; |
| 111 | + fastcgi_pass fastcgi_backend; |
| 112 | + |
| 113 | + fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; |
| 114 | + fastcgi_param PHP_VALUE "memory_limit=256M \n max_execution_time=600"; |
| 115 | + fastcgi_read_timeout 600s; |
| 116 | + fastcgi_connect_timeout 600s; |
| 117 | + fastcgi_param MAGE_MODE $MAGE_MODE; |
| 118 | + |
| 119 | + fastcgi_index index.php; |
| 120 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 121 | + include fastcgi_params; |
143 | 122 | }
|
0 commit comments