|
3 | 3 | # set $MAGE_MODE default; # or production or developer
|
4 | 4 | #
|
5 | 5 | # Example configuration:
|
6 |
| -upstream fastcgi_backend { |
| 6 | +# upstream fastcgi_backend { |
7 | 7 | # # use tcp connection
|
8 | 8 | # # server 127.0.0.1:9000;
|
9 | 9 | # # or socket
|
10 |
| - server unix:/var/run/php5-fpm.sock; |
11 |
| -} |
12 |
| - |
13 |
| - server { |
14 |
| - listen 80; |
15 |
| - server_name m2.magento.loc; |
16 |
| - set $MAGE_ROOT /var/www/magento2; |
17 |
| - set $MAGE_MODE developer; |
| 10 | +# server unix:/var/run/php5-fpm.sock; |
| 11 | +# } |
| 12 | +# server { |
| 13 | +# listen 80; |
| 14 | +# server_name mage.dev; |
| 15 | +# set $MAGE_ROOT /var/www/magento2; |
| 16 | +# set $MAGE_MODE develop; |
18 | 17 | # include /vagrant/magento2/nginx.conf.sample;
|
19 |
| - error_log /var/log/nginx/magento-debug.log debug; |
| 18 | +# } |
20 | 19 |
|
21 | 20 |
|
22 | 21 | root $MAGE_ROOT;
|
@@ -48,7 +47,6 @@ location / {
|
48 | 47 | rewrite / /index.php ;
|
49 | 48 | }
|
50 | 49 |
|
51 |
| - |
52 | 50 | location /static/ {
|
53 | 51 |
|
54 | 52 | if ($MAGE_MODE = "production") {
|
@@ -94,52 +92,51 @@ location / {
|
94 | 92 | add_header Cache-Control "no-store";
|
95 | 93 | expires off;
|
96 | 94 |
|
97 |
| - if (!-f $request_filename) { |
98 |
| - rewrite / /get.php; |
99 |
| - } |
100 |
| - } |
101 |
| - |
102 | 95 | if (!-f $request_filename) {
|
103 | 96 | rewrite / /get.php;
|
104 | 97 | }
|
105 | 98 | }
|
106 | 99 |
|
107 |
| - location /media/customer/ { |
108 |
| - deny all; |
| 100 | + if (!-f $request_filename) { |
| 101 | + rewrite / /get.php; |
109 | 102 | }
|
| 103 | + } |
110 | 104 |
|
111 |
| - location /media/downloadable/ { |
112 |
| - deny all; |
113 |
| - } |
| 105 | + location /media/customer/ { |
| 106 | + deny all; |
| 107 | + } |
114 | 108 |
|
115 |
| - location ~ /media/theme_customization/.*\.xml$ { |
116 |
| - deny all; |
117 |
| - } |
| 109 | + location /media/downloadable/ { |
| 110 | + deny all; |
| 111 | + } |
118 | 112 |
|
119 |
| - location /errors/ { |
120 |
| - try_files $uri =404; |
121 |
| - } |
| 113 | + location ~ /media/theme_customization/.*\.xml$ { |
| 114 | + deny all; |
| 115 | + } |
122 | 116 |
|
123 |
| - location ~ ^/errors/.*\.(xml|phtml)$ { |
124 |
| - deny all; |
125 |
| - } |
| 117 | + location /errors/ { |
| 118 | + try_files $uri =404; |
| 119 | + } |
126 | 120 |
|
127 |
| - location ~ cron\.php { |
128 |
| - deny all; |
129 |
| - } |
| 121 | + location ~ ^/errors/.*\.(xml|phtml)$ { |
| 122 | + deny all; |
| 123 | + } |
| 124 | + |
| 125 | + location ~ cron\.php { |
| 126 | + deny all; |
| 127 | + } |
130 | 128 |
|
131 |
| - location ~ (index|get|static|report|404|503)\.php$ { |
132 |
| - fastcgi_pass fastcgi_backend; |
| 129 | + location ~ (index|get|static|report|404|503)\.php$ { |
| 130 | + fastcgi_pass fastcgi_backend; |
133 | 131 |
|
134 |
| - fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; |
135 |
| - fastcgi_param PHP_VALUE "memory_limit=256M \n max_execution_time=600"; |
136 |
| - fastcgi_read_timeout 600s; |
137 |
| - fastcgi_connect_timeout 600s; |
138 |
| - fastcgi_param MAGE_MODE $MAGE_MODE; |
| 132 | + fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; |
| 133 | + fastcgi_param PHP_VALUE "memory_limit=256M \n max_execution_time=600"; |
| 134 | + fastcgi_read_timeout 600s; |
| 135 | + fastcgi_connect_timeout 600s; |
| 136 | + fastcgi_param MAGE_MODE $MAGE_MODE; |
139 | 137 |
|
140 |
| - fastcgi_index index.php; |
141 |
| - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
142 |
| - include fastcgi_params; |
143 |
| - } |
| 138 | + fastcgi_index index.php; |
| 139 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 140 | + include fastcgi_params; |
144 | 141 | }
|
145 | 142 | }
|
0 commit comments