Nginx
The document root must always point to the public folder, to ensure all functionality works.
1
server {
2
listen 80;
3
​
4
index index.php index.html;
5
server_name localhost;
6
​
7
client_max_body_size 128M;
8
​
9
root __DOCUMENT_ROOT__/public;
10
​
11
# Shopware install / update
12
location /recovery/install {
13
index index.php;
14
try_files $uri /recovery/install/index.php$is_args$args;
15
}
16
​
17
location /recovery/update/ {
18
location /recovery/update/assets {
19
}
20
if (!-e $request_filename){
21
rewrite . /recovery/update/index.php last;
22
}
23
}
24
​
25
location ~* ^.+\.(?:css|cur|js|jpe?g|gif|ico|png|svg|webp|html|woff|woff2|xml)$ {
26
expires 1y;
27
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
28
​
29
access_log off;
30
​
31
# The directive enables or disables messages in error_log about files not found on disk.
32
log_not_found off;
33
​
34
tcp_nodelay off;
35
​
36
## Set the OS file cache.
37
open_file_cache max=3000 inactive=120s;
38
open_file_cache_valid 45s;
39
open_file_cache_min_uses 2;
40
open_file_cache_errors off;
41
​
42
try_files $uri /index.php$is_args$args;
43
}
44
​
45
location ~* ^.+\.svg$ {
46
add_header Content-Security-Policy "script-src 'none'";
47
}
48
​
49
location / {
50
try_files $uri /index.php$is_args$args;
51
}
52
​
53
location ~ \.php$ {
54
fastcgi_split_path_info ^(.+\.php)(/.+)$;
55
include fastcgi.conf;
56
fastcgi_param HTTP_PROXY "";
57
fastcgi_buffers 8 16k;
58
fastcgi_buffer_size 32k;
59
proxy_connect_timeout 300s;
60
proxy_send_timeout 300s;
61
proxy_read_timeout 300s;
62
send_timeout 300s;
63
client_body_buffer_size 128k;
64
fastcgi_pass 127.0.0.1:9000;
65
http2_push_preload on;
66
}
67
}
Copied!
Last modified 5mo ago
Copy link